电子邮件SMTP问题 - 错误:以下发件人地址失败:

I have a fresh install of SugarCRM CE of Version 6.5.16 (Build 1082).

I'm having some issues setting up the SMTP server details in the admin panel. I've tried using the SMTP settings of my domain and also a gmail account and I get the same on-screen error message every time, 'Error:The following From address failed:'

In the diagnostic log, it reads

SMTP -> ERROR: Failed to connect to server. Code: 0 Reply: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? 
SugarPHPMailer encountered an error: The following From address failed: username@gmail.com

If anyone has experienced a similar issue I'd love to know how you fixed it

Thanks in advance

That error message is most likely related to SugarCRM/PHP and the webserver not having access to SSL-enabled email hosts. Depending on your system, you may be missing the libssl (libssl1.0.0) package or openssl altogether.

If your system is old enough, SSL support may even be compiled and packaged seperately. Older Debian and Ubuntu systems called it php5-ssl if I recall correctly. But for the past few years, SSL support has been built in to the core PHP module.

I just had such issue with an old joomla, you can't imagine. I followed this a couple of times: https://support.google.com/mail/answer/14257?hl=en

Also for port only TLS vs 587 worked for me. The SSL port did not. And additionally I had to go to accounts.google.com -> security -> audit and confirm activity from device (the web server actually) is legitimate. Crazy thing but finally it worked. I hope it will still work going forward. And one more thing - the username is the full email address, not only the part before @gmail.com

In our case, the Antivirus mail shield was blocking the communication to the SMTP server. We disabled the mail shield and got it working.

I ended up using localhost for the outgoing SMTP server because I saw this in my php.ini file:

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

And I used the 587 with TLS.

It ended up working out for me. I use the GoDaddy email server. (I honestly don't know why it worked so if you know it would be so awesome explain, Thanks!)