PHP mail settings

dreamer123456
dreamer123456 used Ask the Experts™
on
I have godaddy VPS. Its windows server with plesk. Two websites are hosted. for one of them email function works for the other one it gives 503 error, smtp authentication, This mail server requires authentication when attempting to send to a non-local e-mail address.
Comment
Watch Question

Do more with

Expert Office
EXPERT OFFICE® is a registered trademark of EXPERTS EXCHANGE®
Distinguished Expert 2017
Commented:
Commonly, the php.ini defines the mail handling, when hosting different site, the mail handling becomes more difficult
Your options are either install iis SMTP component if not installed already and use the local to handle the delivery.
Alternatively, if each domain has to send through their respective provider and thus use an SMTP session to the specified host..
The 503 means an internal failure such that looking through the log, or including debug/logging of errors that you can refer back to in order to identify what the cause for the error is.

The auth requirement is in place to avoid/prevent server from being misused as a spam distributor.

Php includes process that deals with SMTP auth.
If using local, there is a configuration dealing with relaying that you can authorize relaying to any recipient.
Scott FellDeveloper & EE Moderator
Fellow 2018
Most Valuable Expert 2013
Commented:
Do you have email turned on for the other domain?  It should just work. If you have to use authentication, then you can't use the base mail function http://php.net/manual/en/function.mail.php because it does not support authentication.

I have stopped using the server to send out email a long time ago and have used either sendgrid or mandrill.
Developer & EE Moderator
Fellow 2018
Most Valuable Expert 2013
Commented:
In plesk, go to Tools Settings > Mail Server settings.  On mine it is  https://domain.com:8443/plesk/server/mail/

There you will see the relay restrictions are  probably on,and you can add IP's, "Use no relay restrictions for the following networks:"

Author

Commented:
I created a mailbox for my domain since it was not allowing email to non-local account. I set up mail forwarding from that email. This works but no other solution worked.

Do more with

Expert Office
Submit tech questions to Ask the Experts™ at any time to receive solutions, advice, and new ideas from leading industry professionals.

Start 7-Day Free Trial