tomasdev

web development handcrafted

SMTP server response: 553

20 Jun, 2009. Written by Tom Roggero

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.

5 Comments /

junel
16/10/2009

Hi tom,

the error Warning: mail() [function.mail]: SMTP server response: 553 We do not relay non-local mail is gone, but the email doesnt reach its destination… I tried to send it by my own account but its not in there.

is there any configuration need to setting up?

Junel

Tomas
27/10/2009

Hi Junel, a few questions to try to understand the problem:

Are you using XAMPP with Mercury Mail ?
Are you getting any error with Error_Reporting(E^ALL); ?
What did you mean with “tried to send it by my own account” ?

Qaisar
24/12/2010

i m facing same problem, SMTP 553 error gone but unable to recieve mail… any idea??
thanks

Aliasve
21/09/2011

Thanks for your support, the information posted for you has been very helpfull, thanks

Leave a Reply