SMTP server response: 553

So you probably had recently finished installing Mercury Mail, maybe using XAMPP or kind-of. As I checked, without modifying anything from download, it always happens. I mean running Windows (XP Service Pack 2), because of Mac version of XAMPP doesn't support Mercury Mail Server.
And, for my surprise, I got an error:

Warning: mail() [function.mail]: "sendmail_from" not set in php.ini or custom "From:" header missing in /root/web/tests/mail.php on line 3

Where my piece of code was:

$email = "me@tomasdev.com.ar";
$subject = "Hello";
$body = "Hi dude, how are you?";
mail($email, $subject, $body);
?>

So after reading stuff and documentation of PHP, I found that you must set sendmail_from in your php.ini but for personal reasons, I don't touch the configuration files (you shouldn't either). So the solution I found was adding the necessary settings via code:

$email = "me@tomasdev.com.ar";
$subject = "Hello";
$body = "Hi dude, how are you?";
$headers = "From: anonymous@anonymous.com"
mail($email, $subject, $body, $headers);
?>

But again, something happend! (last code fixes the previous error, but there is still an error)

Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail, sorry. in /root/web/tests/mail.php on line 3

And, the magic fix is just following this guide of 4 simple steps.
(I MADE IT SO PLEASE DONT COPY PASTE)

- Step 1:
Open your XAMPP Control Panel and click on Admin Button for Mail
Step 1 fixing 553 error

- Step 2:
On the Mercury Mail administration window, go to Configuration » MercuryS SMTP Server which will open a new window.
Step 2 fixing 553 error

- Step 3:
Go to the Connection Control tab and look for Relaying Control zone.
Step 3 fixing 553 error

- Step 4:
So probably there is an option checked which says Do not permit SMTP relaying of non-local mail. Make sure to uncheck that option, and then click OK/Apply.
Step 4 fixing 553 error

That's all, and it should fix your problems for mailing. Any question, asking is free.

Share and Enjoy:
  • Digg
  • del.icio.us
  • StumbleUpon
  • Twitter
  • Tumblr

About this entry