Developer forum

Forum » CMS - Standard features » Enabling SSL for SMTP

Enabling SSL for SMTP

Terri Donahue
Terri Donahue
Reply

Hi Team,

Is there a trick to getting SSL to work in the SMTP settings? I have tried 587 and choosing SSL for the configuration and it never passes when I test it.

Thanks,

Terri


Replies

 
Nicolai Pedersen
Reply

Hi Terri

Do you get an error message in the yellow test result box? And what does it say?

 
Terri Donahue
Terri Donahue
Reply

Sure thing. Here are the errors for different ports.

25-error.png 587-error.png
 
Nicolai Pedersen
Reply

Well, it indicates that the SMTP server does not support SSL or it uses a different port for the communication.

 
Terri Donahue
Terri Donahue
Reply

We were able to verify SSL works on port 25 using powershell but an error is returned when trying to set this configuration on the SMTP setting page. Also, if you don't choose the SSL checkbox, even if it verifies as OK, mail does not send since O365 requires SSL.

 
Nicolai Pedersen
Reply

Hi Terri

Maybe this is an old Dynamicweb then? This could be the TLS1.2 issue you have encountered in other situations.

Need to set System.Net.ServicePointManager.SecurityProtocol = SecurityProtocolType.Tls12;

Or you might just update to run the site with .net framework 4.6 - believe it uses tls 1.2 by default as far as I recall...

BR Nicolai

 
Terri Donahue
Terri Donahue
Reply

We are using Dw 9.7.2. I am not able to get SSL to work. Sending to smtp.office365.com requires SSL. Any other idea?

 
Nicolai Pedersen
Reply

Hi Terri

Can you check that defaultCredentials is NOT set to true in web or app config? Or not have mailSettings section at all - default value of this setting should be false.

See https://docs.microsoft.com/en-us/dotnet/framework/configure-apps/file-schema/network/mailsettings-element-network-settings?view=netframework-4.8

 
Adrian Ursu Dynamicweb Employee
Adrian Ursu
Reply

Hi guys,

Can I suggest to also check if it works with SSL regardless of the message displayed in the settings interface?

I have found at least 2 versions of DW where we got an error message on the test but the send actually worked.

Adrian

 

 
Terri Donahue
Terri Donahue
Reply

Thanks for the suggestions guys. I'll test and update this thread.

 
Nicolai Pedersen
Reply

Hi Terri

Adrian has a point - it does work when sending a real email, but for some reason the SMTP test button (which is using a TCP Client to test with), fails when handshaking with smtp.office365.com.

I have changed the test button so it has a fallback in this situation. Should work with 9.8.

Until then, test using a form or similar.

BR Nicolai

 

You must be logged in to post in the forum