Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I use TLS email with web.config

Tags:

Here is my web.config file:

<system.net>     <mailSettings>         <smtp from="[email protected]"  >             <network host="smtp.gmail.com" port="587" userName="[email protected]" password="yyy" />         </smtp>     </mailSettings> </system.net> 

I need to enable TLS, a requirement of my email server. However I only see SSL.

like image 649
Jonathan Allen Avatar asked Jun 20 '11 05:06

Jonathan Allen


People also ask

How do I send an email using TLS?

Add the Secure transport (TLS) compliance setting to always use TLS for email sent to and from domains and addresses that you specify. When composing a new Gmail message, a padlock image next to the recipient address means that the message will be sent with TLS.

How to set SMTP settings in web config?

This site needs to be hosted on a new web server having a different SMTP server. Just configure IIS so that SMTP localhost fowards mail to relay.tagadab.com.


1 Answers

Its actually equivalent - TLS is kinda of broader than SSL. So use enableSsl= "true" for enabling TLS. As per MSDN documentation, that will force SMTPClient to use RFC 3207 (and RFC uses both terms TLS/SSL).

<network enableSsl="true" host="smtp.gmail.com" port="587" ... 
like image 186
VinayC Avatar answered Sep 20 '22 07:09

VinayC