Mail cannot be sent through AtMail error “Could not send message to SMTP server. Check you have access to send messages via the server and that all To/CC/BCC addresses are valid\nError: SMTP Server rejected email. Returned:553″
Emails cannot be sent through AtMail. When click Send Mail popup window is created with the following message:
Could not send message to SMTP server. Check that you have access to send messages via the server and that all To/CC/BCC addresses are valid\nError: SMTP Server rejected mail. Returned:553
What may cause the problem?
Solutions :
Seemed like atmail didn’t authenticate when trying to send the email. After searching through the sources found that in the @mail config file (/var/www/atmail/libs/Atmail/Config.php) there is an option to authenticate with an username/password
‘smtpauth_password’ => ”,
‘smtpauth_username’ => ”,
by default they’re empty.
if you put here a valid username and password, the messages will be sent.
The problem is that I wanted that the users authenticate with their own credentials when sending messages.
So here’s the way I fixed it:
Open the file /var/www/atmail/libs/Atmail/SendMsg.php
Search for the line “// Optionally authenticate with the SMTP server”
Add below line :
$auth =& $atmail->getAuthObj();
$pref['smtpauth_username'] = $auth->Account;
$pref['smtpauth_password'] = $auth->password;
That’s it. This will override the auth settings from Config.php with the credentials the user used to log in.
After that try to send an email it will work.

