Page 1 of 1

SOLVED: mail function, localhost, & email domain name

Posted: Sun Jan 22, 2012 1:04 am
by mondsteigen
I have a problem with using mail function to send email from localhost. It works only with @gmail.com address. I've tried with @yahoo.com and .me addresses; mails are sent to those addresses (I know this because I don't get the error message) but they don't arrive. How can I solve this problem?

Re: mail function, localhost, & email domain name

Posted: Sun Jan 22, 2012 6:37 am
by Celauran
mondsteigen wrote:mails are sent to those addresses (I know this because I don't get the error message)
This is not necessarily true. The mail() function returning TRUE does not mean your MTA successfully delivered the mail. Check your mail server logs.

Re: mail function, localhost, & email domain name

Posted: Sun Jan 22, 2012 11:23 am
by mondsteigen
I checked the log. It says
to=<xxxxxxxx@ymail.com>, relay=mta1.am0.yahoodns.net[66.94.238.147]:25, delay=28684, delays=28690/0.01/0/0.05, dsn=5.0.0, status=bounced (host mta1.am0.yahoodns.net[66.94.238.147] said: 501 Syntax error in parameters or arguments (in reply to MAIL FROM command))
You were right, Celauran. How can I fix this?

Re: mail function, localhost, & email domain name

Posted: Sun Jan 22, 2012 11:36 am
by Celauran
The error suggests a malformed 'from' address. Are you adding From headers to the mail() call?

Re: mail function, localhost, & email domain name

Posted: Sun Jan 22, 2012 12:08 pm
by mondsteigen
Yes. It reads:

Code: Select all

$headers = 'From: me <me@hushmail.me>';
This works when I send mails to gmail addresses. Do you think it's a problem with the receiving side? Do I need to config php.ini somehow?

Re: mail function, localhost, & email domain name

Posted: Sun Jan 22, 2012 5:55 pm
by mondsteigen
This problem is now solved.