- Plesk for Windows
Unable to send an email via PHP script on Windows.
The following error is displayed upon accessing the script in a web browser if
ini_set( 'display_errors', 1 );is defined in the script:
CONFIG_TEXT: Warning: mail(): SMTP server response: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.
Localhost addresses are not added to Tools & Settings > Mail Server Settings > White List.
Also, the following error can be seen under MailEnable > Server > localhost > Services and Connectors > SMTP > logs > Activity:
CONFIG_TEXT: 503 This mail server requires authentication when attempting to send to a non-local e-mail address. Please check your mail client settings or contact your administrator to verify that the domain or address is defined for this server.
SMTP server requires authentication in order to send mail to non-local addresses.
- Login to Plesk
- Add localhost addresses to the Whitelist at
Tools & Settings > Mail Server Settings > White List > Add Address:
Note: If localhost addresses are added to Whitelist, emails will not be counted towards the Outgoing Mail Limit.
If localhost addresses cannot be whitelisted, define proper authorization credentials in the mail script.
If it does not help, follow next steps:
Connect to a Plesk server via RDP.
Launch MailEnable Management console at Windows Start > All Programs > Mail Enable.
- In MailEnable Management console, expand Servers > localhost > Services and Connectors > right-click on SMTP and open its Properties.
In SMTP Properties window, switch to the Security tab and disable the options Disable all catchalls and Authenticated senders must use address from their postoffice (or Authenticated senders must use valid sender address). Click the Apply button.
Switch to the Relay tab > Privileged IPs... and select Denied relay rights.
To allow sending emails through the server from a web server or web page, add the IP addresses of those users who are able to send email out through the server:
Restart the MailEnable SMTP Connector service:
6.1. In MailEnable Management console, go to Servers > localhost > System > Services Status.
6.2. Select MailEnable SMTP Connector.
6.3. Click Restart in the right panel.