SMTP connect() failed.

I have issue in Outbound Email.
Some days before Email Setting working properly.

Suddenly setting is not working. I am checking and reset all setting but facing following error in log:

SugarPHPMailer encountered an error: SMTP Error: Could not authenticate.

Please help me related this issue

What is your SuiteCRM version?

What did you change to make it stop working? Did you upgrade?

That error is coming from your email server. It’s typically caused by a wrong password… if you go into the email settings, and try the “send test email” button, and it fails, you get a link to an extended log that might help you figure out the cause.

I am using SuiteCRM v 7.9.7

I have not upgrade suite in between working and not working email setting.

Same Email setting working in another suite with same version.

Yes May be last log due to wrong password

but another log is:

-->  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.
--> SugarPHPMailer encountered an error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

In the “Send Test Email” button, do you see a link saying “SMTP Full log” when it fails?

Hello Mr @pgr
I do not know how to describe it, with version 7.10.5 emailing with SMTP is perfect. However, when upgrade to version 7.10.7, will not be able to send emails. error related to class.smtp.php


3: Connection: opening to ssl://smtp.yandex.com:465, timeout=300, options=array (
)
3: Connection failed. Error #2: stream_socket_client(): SSL operation failed with code 1. OpenSSL Error messages:
error:14090086:SSL routines:SSL3_GET_SERVER_CERTIFICATE:certificate verify failed [/home/myaccounthere/public_html/suitecrm.yesdomain.com/include/phpmailer/class.smtp.php line 298]
3: Connection failed. Error #2: stream_socket_client(): Failed to enable crypto [/home/myaccounthere/public_html/suitecrm.yesdomain.com/include/phpmailer/class.smtp.php line 298]
3: Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.yandex.com:465 (Unknown error) [/home/myaccounthere/public_html/suitecrm.yesdomain.com/include/phpmailer/class.smtp.php line 298]
1: SMTP ERROR: Failed to connect to server:  (0)
3: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
  • I tried changing to Google Mail but could not improve the situation!
    Please help me for this issue. Thanks

Check your server certificate. Or get one with Let’s Encrypt, if you don’t have one already.

I don’t know exactly what changed in that upgrade, probably a new version of phpmailer inside SuiteCRM. It is also possible that your certificate simply expired around the same time.

But that error is coming from the server, and it’s a SSL error.

@pgr this is erro :: Error:SMTP Error: Could not authenticate.
i could not found any topic for my case, sorry this forum also on Github, look at that, Gmail with certificate i think there is no problem. Or get one with Let’s Encrypt i’ve just renew one. it’s oki. I tried change to 3 email provider with SSL and TLS - can not find a solution for this (7.10.5 and 7.10.6 immunity - same server, same code, nothing change )
Thank you so much!

Hi kishah2411

Create New Outbound Email account,
SMTP Server Name : smtp.gmail.com
chech “SMTP Auth” check box
SMTP Port 587
SMTP Protocol : TLS
correctly fill your Username and password.

After that test your email click on send test email

work correctly :slight_smile:

I fixed using Google Account App passwords
This person explain well to generate app password and use this one instead of your real password
https://youtu.be/4TmD4ly7V_E?t=166

Then I updated all below
SuiteCRM \ Outgoing Mail Configuration \ Email Settings
SMTP Mail Server: smtp.gmail.com
SMTP Port: 587
Use SMTP Authentication: check
Enable SMTP over SSL or TLS: TLS check
Gmail Email Address: myemail@gmail.com
Gmail Password: *** *** use the one from Google Account App passwords
Users may send as this account’s identity check

PHP.INI
    [mail function]
        SMTP=smtp.gmail.com
        smtp_port=587
        sendmail_from = myemail@gmail.com
        sendmail_path = "d:\xampp\sendmail\sendmail.exe -t"

TO TEST EMAIL USING ANOTHER SMAPP APP USING XAMPP EMAIL
MANUAL TEST CONFIGURATION TO SEE IF YOU CAN OUTPUT EMAILS
D:\xampp\sendmail\sendmail.ini
[sendmail]
smtp_server=smtp.gmail.com
smtp_port=587
smtp_ssl=tls
error_logfile=error.log
debug_logfile=debug.log
auth_username=myemail@gmail.com
auth_password=vkaz kfhe qdze msnw
force_sender=myemail@gmail.com
force_recipient=myemail@gmail.com
hostname=
***where auth_password is the Google Account App passwords

MANUAL TEST
pushd in cmd to D:\xampp\sendmail
@ECHO OFF
REM send email from command line via SMTP with sendmail
ECHO From: myemail@gmail.com > %TEMP%\temp.mail
ECHO To: myemail@gmail.com >> %TEMP%\temp.mail
ECHO Subject: this is a test >> %TEMP%\temp.mail
ECHO.>> %TEMP%\temp.mail
ECHO testing. >> %TEMP%\temp.mail
ECHO blah blah… >> %TEMP%\temp.mail
ECHO.>> %TEMP%\temp.mail
ECHO blah. >> %TEMP%\temp.mail
sendmail -t < %TEMP%\temp.mail
DEL %TEMP%\temp.mail