I have a problem with sending mails from my SuiteCRM system. It has suddenly stopped working in the middle of last month. I’m using a mail from office365. It stopped working out of the blue. I have tested with multiply mails and also gmails.
The log show the following:
Tue Nov 7 13:19:03 2017 [12972][1][FATAL] SugarPHPMailer encountered an error: An outgoing mail server is not configured to send emails. Please configure an outgoing mail server or select an outgoing mail server for the mail account that you are using in Settings >> Mail Account.
Tue Nov 7 13:19:03 2017 [12972][1][FATAL] SugarPHPMailer encountered an error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
I have now tried the changes you posted, and got the following error messages:
The “removed” has been changed by me from the logs.
Thu Nov 9 07:49:58 2017 [21464][1][FATAL] ------------ Entering SugarMailer send
Thu Nov 9 07:49:58 2017 [21464][1][FATAL] PHPMailer Send Function override: { FromName: removed From: removed Host: smtp.office365.com UserName: removed }
Thu Nov 9 07:49:58 2017 [21464][1][FATAL] ------------ Entering smtpConnect
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtpConnect: { 3: Connection: opening to smtp.office365.com:587, timeout=300, options=array ( }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtpConnect: { ) }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtpConnect: { 3: Connection failed. Error #2: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known [/var/www/html/include/phpmailer/class.smtp.php line 299] }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtpConnect: { 3: Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.office365.com:587 (php_network_getaddresses: getaddrinfo failed: Name or service not known) [/var/www/html/include/phpmailer/class.smtp.php line 299] }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtpConnect: { 1: SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Name or service not known (0) }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] SugarPHPMailer encountered an error: An outgoing mail server is not configured to send emails. Please configure an outgoing mail server or select an outgoing mail server for the mail account that you are using in Settings >> Mail Account.
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] ------------ Exiting smtpConnect
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] SugarPHPMailer encountered an error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtp send: { 3: Connection: opening to smtp.office365.com:587, timeout=300, options=array ( }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtp send: { ) }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtp send: { 3: Connection failed. Error #2: stream_socket_client(): php_network_getaddresses: getaddrinfo failed: Name or service not known [/var/www/html/include/phpmailer/class.smtp.php line 299] }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtp send: { 3: Connection failed. Error #2: stream_socket_client(): unable to connect to smtp.office365.com:587 (php_network_getaddresses: getaddrinfo failed: Name or service not known) [/var/www/html/include/phpmailer/class.smtp.php line 299] }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtp send: { 1: SMTP ERROR: Failed to connect to server: php_network_getaddresses: getaddrinfo failed: Name or service not known (0) }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] smtp send: { 3: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting }
Thu Nov 9 07:50:39 2017 [21464][1][FATAL] ------------ Exiting SugarMailer send
It looks like your host names aren’t resolving in DNS. Maybe you can check your DNS configuration, your /etc/hosts file, and make sure PHP can reach your server by name.
A simple test to see if that’s really the problem: to change your server name from smtp.office365.com to whater IP address you get from “nslookup smtp.office365.com”
Yeah, I’m glad it helped. We have to get that into the product.
A word of warning, though: in its current form, when you connect to the SMTP server, your logs will include the full SMTP debugging log.
This contains usernames and passwords, which look encrypted but are not, they are merely BASE64 encoded, which anyone can decode easily. So the above code is NOT for production, and is not secure to leave in place - make sure you deactivate it.
Thu Dec 14 14:28:04 2017 [165228][1][FATAL] ------------ Entering SugarMailer send
Thu Dec 14 14:28:04 2017 [165228][1][FATAL] PHPMailer Send Function override: { FromName: SuiteCRM From: do_not_reply@lindexcrm.com Host: smtp.gmail.com UserName: lindexsuite@gmail.com }
Thu Dec 14 14:28:04 2017 [165228][1][FATAL] ------------ Entering smtpConnect
Thu Dec 14 14:28:04 2017 [165228][1][FATAL] Internal PHPMailer smtpConnect Exception: { Extension missing: openssl } ---------------
Thu Dec 14 14:28:04 2017 [165228][1][FATAL] SugarPHPMailer encountered an error: An outgoing mail server is not configured to send emails. Please configure an outgoing mail server or select an outgoing mail server for the mail account that you are using in Settings >> Mail Account. Extension missing: openssl
Thu Dec 14 14:28:04 2017 [165228][1][FATAL] ------------ Exiting smtpConnect
Thu Dec 14 14:28:04 2017 [165228][1][FATAL] SugarPHPMailer encountered an error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Thu Dec 14 14:28:04 2017 [165228][1][FATAL] SugarPHPMailer encountered an error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Thu Dec 14 14:28:04 2017 [165228][1][FATAL] Exception in Controller: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
This is what I’ve got in log file but I changed the line in php.ini and restart apache but still this problem.
If you got any idea what is the problem that could help me, I would be glad to hear it.
You need the openssl extension in PHP, try Googling for how to install it. This is probably only required because of your security options in that account (SSL).
I don’t know how it works on Windows, but you probably need to tell PHP to load that extension in php.ini.
You’re better off asking Google for this sort of thing, not here… what you’re getting is not a specific problem with SuiteCRM, it’s your PHP configuration.
Hi I have found a solution to SuiteCRM logging out after trying to send mail. It does not fix the error but is an easy work around until a fix implemented and I hope it also works for you.
Please goto “Profile” > scroll down to “Email Client” and select “External Email Client”
This allows the system to use your system email client.