Email Configuration and Usage Doubts

Hello everyone,

I was configuring the email settings so I could send emails using SuiteCRM and come across some issues, for which I already searched and tried some approaches I saw on the internet but without results.

First let me tell you what I have done step by step. I have started to use version 7.9.0 but now I have upgraded to 7.9.7.

  1. I have configured a email account in the Email Settings of SuiteCRM and sent a Test Email which works as expected, I have received the test email. The confiured email account is an microsoft office 365 account. My first doubt is that if the configured email account does not have the “Use SMTP Authentication:” checkbox checked then the “Allow users to use this account for outgoing email:” checkbox is not available for setting. Is there some limitation regarding this as the account I am using does not have SMTP authentication?

  2. I have notice that when I go to contacts and on the Contacts List View and I choose a email, the compose popup appears correctly, but the “From:” drop down does not present results. I have read that we need to configure ab inbound email account so that the “From:” drop down is populated but after doing so (inbound_account_configuration.png) the result is the same. What is required to populate the “From:” drop down? (contact_list_view_popup.png)

  3. If I enter the contact details and select an email the compose popup is not presented correctly. The Body editor does not show and no information regarding the contact email address is filed. Is there some kind of problem with the compose email popup on the contact detail view? (contact_detail_view_popup.png)

  4. When trying to select an email template on the compose email popup, a message is presented with undefined. For what I saw this seems to be a bug, is this correct? (contact_template_popup.png)

  5. Trying to populate the “From:” drop down on the compose email popup I also configured Outbound Email Accounts, one using the microsoft office 365 account, that works correctly, and a gmail account that when I try to send the test email gives a Error:SMTP connect() failed. the log file only gives the following entries:

After validating the configuration everything seems correctly configured. (outbound_email_account_config.png)
Is there something I am doing wrong?

Can somebody please help shed some light on the subject.

Thanks in advance.

Had to add the attachments in a different message.


The undefined is a bug which should be fixed in the next version - but make sure that is the only “undefined” you’re getting. If you get a lot of them, on different parts of SuiteCRM, that would indicate wrong Linux permissions on your installation.

There are some advanced SMTP troubleshooting instructions here:

(Don’t post those log results here unless you obfuscate your email passwords first, they are shown base64 encoded, which seems like encryption, but is not.)


I added the code as indicated but when testing a previously working email, the one configured in the Email Settings, the SugarPHPMailer. php gets stuck in the $connection = parent::smtpConnect(); on the front end it shows the popup “One moment please…” Is it normal to take a long time to execute due to the debug?

Also regarding the other issues I stated such as the “From:” field not being populated in the Email compose popup and the pop not showing correctly from the details, do you have any idea why that is?

Thanks in advance.


this only adds logging, it doens’t change the way the email is sent. So any delays you get with this code should be exactly like the delays you get without it.

You can, however, tail your log for FATAL errors (it’s logging everything as FATAL just for convenience) and see when and where it’s delayed.

There are many Email bug fixes coming for the next release. If you can take a moment to scan Github issues (both open and recently closed) maybe you find your problem, and some workaround…


After some messing around I was able to use the code you sent to test the email but I had to remove the bit below as with it the script didn’t end.

$this->Debugoutput = function($str, $level) {
	$this->phpMailerFullLog .= "$level: $str\n";

Afterwards I was able to verify that for an outbound email account the values that are used are the Correct SMTP Server and username but the password that was being used was the one configured in the Email Settings that refers to my office 365 email account, and with that the error below was returned:

12/12/17 20:56:48 [2028][1][FATAL] Internal PHPMailer smtpConnect Exception: { SMTP Error: Could not authenticate. } ---------------
12/12/17 20:56:48 [2028][1][FATAL] SugarPHPMailer encountered an error: The outbound mail server selected for the mail account you are using is invalid. Check the settings or select a different mail server for the mail account.

This seems to be a bug as the information to use should all be obtained from the configured outbound email account, don’t you agree?

Thanks in advance.

About the wrong password: can you try simply re-entering it in the appropriate screen? Tell me if this works.

About the debug code not running: now I am very interested in your case, because I want that code to go into SuiteCRM in the next version, and I don’t want it to break people’s systems :slight_smile:

First, are you sure you copied the code correctly, including the declaration of phpMailerFullLog? when that code doesn’t run, you should have an error in php_errors.log, do you? What is it?

Can you please tell me the details about your system:

  • OS distro and version
  • PHP version
  • SuiteCRM version


The first thing I tried was to retype the password but the problem persisted. To test I override the password on the send method and it worked fine. It seems the password is being incorrectly obtained from the email settings and not form the configured outbound email account.

The debug code I copied it correctly, including the declaration. I added a few debug entries just to see where the code stopped running, but that was it. Ill add the code if you would like to see it.

On the php error log I can’t see any error besides this:

[13-Dec-2017 12:18:42 Europe/Minsk] PHP Warning:  PHP Startup: Unable to load dynamic library 'C:\Program Files (x86)\PHP\v5.3\ext\php_wincache.dll' - The specified module could not be found.
 in Unknown on line 0

As to the system information:
OS: Windows 7 Ultimate w/ Service Pack 1
PHP Version: 5.3.28
SuiteCRM Version: 7.9.7

Here’s your problem:

The minimum supported PHP version for SuiteCRM is 5.5, and I really recommend that you simply upgrade to 7.x, much faster and more secure.

This PHP upgrade is the first thing to try for all the other SuiteCRM issues you might have. The app breaks in several places with 5.3.

That’s why you had to remove that line from my code, that construct is one of the new things in 5.5…


I’ve upgraded the PHP version and your code works correctly with the PHP 7.1.
Also the wrong format on the compose email popup in the details view is also solved with this.

I’ve tested the send email and confirmed that for every outbound account the user and password used is the one configured in the email settings.

Also I’m not able to see email accounts populated in the “From:” field, is there something I’am missing?

Thanks in advance.

I’m sorry, I’d love to help you more, but I have no idea why you don’t see your accounts in the “From” list… thy really should be there.

The PHP issue might be to blame - you could be getting some wrong behaviour while you were configuring, and now there might be problematic things in your database. I don’t want to tell you to repeat your entire configuration, that’s a pain…

There are probably new releases coming up today or tomorrow and they will have some more fixed email bugs. So maybe you could wait for those a try them when they come out.

Also, have a look at the outbound_email and inbound_email tables in your database. Ignore any lines with “deleted=1”. You might be able to understand better what’s going on from what you see there.

1 Like


Don’t know if you can help but after some investigation, I got to te point where the outbound email account is not appearing because of this code in EmailsController.php.

  if(in_array($inboundEmail->id, $showFolders)) {

For what I can see the id of the configured outbound email account is not present in the preference showFolders. The problem is I don’t see any place on the configuration to set this preference.

Anyone knows how to set this preference?

Thanks in advance.

I’m not sure, but maybe here:

  • User Profile
  • scroll down to Email settings
  • click Settings button
  • general tab
  • there’s a Folder management thing there

Or another place is the button at the top-right of the Email List view, folder selector.