I’m working on a windows based server and I am wondering why a server would return this error message when using the mail() function:
Warning: mail() [function.mail]: SMTP server response: 554 Invalid From address:
xxxxx@MyDomain.com. Could not find domain MyDomain.com on our servers.
The email From address must be of type any_valid_name@yourdomain.com in
\\web-123win\winpackage22\MyDomain\web\content\mail.php on line 16
I mean, isn’t the mail() function supposed to send emails to whatever domain we want?
Can you help me in the understanding of this message? thanks
Since spam become the 99% of all e-mail traffic most mail servers no longer accept all mail they’re handed. Instead, they only accept messages from these categories:
Your mail appears to belong to the second category so you must provide a proof of identify so they know you’re allowed to user their mail system. The details depend on the mail provider but you’re normally required to provide a username and password.
Said that,
mail()function does not implement authentication so you need to use a third-party package like PHPMailer or Swift Mailer.