Email passwords being lost again.


I have never actually managed to make good use of the email module - but i have wrestled with smtp errors a few times and managed to get email notifications working. All good - until it stops working again, presumably its the upgrades?

At the most basic level…

My situation now is that If i go to

Admin>Email Settings>Outgoing Mail Configuration and then set the password before clicking “Send Test Email”, it works.
But if i click “Send Test Email” a second time it fails with the error “SMTP Error: Could not authenticate”

Attempting to set the password and saving the Email settings also results in the same error.

Basically the “send Test Email” only works immediately after setting the password.

i am slowly losing hope :frowning:

Maybe this can help you:

I’ve experienced the same problem and I ended up having a static SMTP credential for the outbound email as it would always fail to authenticate otherwise.


By setting ‘static SMTP credential’ do you mean setting

    $this->Password = 'password';

in the SugarPHPMailer.php file?

That seems to have worked

@Bungle, on which SuiteCRM version are you?

Version 7.10.4
Sugar Version 6.5.25 (Build 344)

Can you please try to check if, despite that error, the account gets properly set up, and works well?

I am just trying to get a better idea of where the bug is.

Unfortunately it only works if i set the password in SugarPHPMailer.

The test email in Admin>Email Settings is only sent immediately after setting the password box. The second time i click ‘send test email’ it fails, even though i have not saved the page.

However, in ‘Admin>Outgoing Email’ the test email works indefinitely - until the settings are saved.


Setting the password in ‘Admin>Outbound Email’ updates the ‘mail_smtppass’ for the ‘system’ type account in the ‘outbound_email’ table; to the correct value - and my workflows send email. All good.

However, setting the password in ‘Admin>Email Settings’ updates the same field in the table, but with an incorrect value - email stops working.

This may explain why my email stopped working - it wasn’t the upgrade, email password changed and i most likely tried to update the password in Admin>Email Settings.

The error must be in the code that writes the password in the ‘Admin>Email Settings’ page?

Hello. I’ve been trying to reproduce your Issues in my test installation of 7.10.4, but I can’t.

I tried the one about sending the test email twice, but it works well both times.

I tried changing the password from the Admin / Email settings screen, but it changes the password correctly for me…


Very strange, i haven’t customised any code - perhaps my instance hasn’t upgraded properly at some point?

For the moment i have a workaround, though not sure how secure it is to have the password in SugarPHPMailer?

You and me both on this one.

Setting the password as static should be relatively safe as long as no one has access to your codes. And who would look into a SugarPHPMailer file?

This just occurred recently for us.

Both of you, please don’t give up on getting to a reproducible version of this bug. We need to be 100% relentless with Email bugs, squash all of them one by one until we drive up the quality in this module. This is much needed and my main concern at the moment.

i don’t want to give up, i just don’t have the skill set to find the root of the problem. But i am more than happy to help if i can.

The help file mentions 4 types of email accounts, and one of those is outgoing email accounts. It then goes on to say that you set the default email settings in Admin>Email Settings.

However there is also a system type email account listed in Admin>Outgoing Email.

This is duplicating the way you can set the default settings and is confusing, and its also making it harder to locate the problem.

Getting rid of the Admin>Email Settings page would be the best option - leaving just one page (outgoing Email) where you setup a ‘system’ type account for default settings.

Now i need to find out why the personal email has stopped working too, its just saying loading in the mail settings page - then crashes the system with a proxy error? The proxy server received an invalid response from an upstream server. The proxy server could not handle the request GET /crm/index.php.


On the plus side, we’ve narrowed it down to the authentication problem. I’ve also noticed that multiple credentials are stored on the “outbound_email”. The problem might lie on the queries that fetch the credentials to be used for the SMTP.

Thanks to both of you.

@iamreb, what do you mean about the outbound_emails table? Do you get more than one row for a single account? If you can paste (obfuscated) contents of your table, I would appreciate it.

After today’s upgrade to 7.10.5 the Admin>Email Setting page does not save the record at all; no error message in log file (previously i had incorrect password being saved)

As a result i now now have an error message which is appearing on every single view, which on a mobile device takes up a LOT of screen space.
: “Note: To send record assignment notifications, an SMTP server must be configured in Email Settings.”.

On the plus side, the emails are still being sent; which i assume is because the outbound_email table is no longer being update with the incorrect password.

This post solved the problem for me .

After resetting the static password in sugarPHPMailer i’m back to where i was before the upgrade


Yes upon checking there are duplicates in the “outbound_email” per “user_id”

Did you pay attention to the “deleted” column? If “deleted=1” they won’t be used.