SMTP server response: 553 5.3.0 … DISCARD Spam Relay

[Sending email from a Windows server using PHP]

I got the cryptic error message above while trying to send email using PHP from a Windows server.  Turned out that the problem was that php.ini had set the sendmail_from entry to the silly value “me@localhost.com.”  Since this is a shared hosting situation, we couldn’t change php.ini directly.  However, we were able to use the ini_set function in the script that sent the mail:

ini_set(”sendmail_from”, “a-real-address@the-actual-domain.com”);

This fixed the problem.

  • Wilson
    Excellent tip! This was EXACTLY what was needed to get me going! Thanks!
  • SandraMillhouse
    That's why you need your own private server. With shared you can't access all the configuration setting you might need to change in order to make things work properly.
    Sandra Millhouse | cheap virtual server
  • Mike
    you just saved me a lot of time! thanks for this post!
  • Conrad
    Thank you very much! That fixed my issue!
  • Erich
    Thank you for posting this solution!
  • Name
    Where does it go
  • Andrew
    Thanks! This solved a problem I was having
blog comments powered by Disqus