This documentation is archived and is not being maintained.

SmtpNetworkElement.EnableSsl Property

Gets or sets whether SSL is used to access an SMTP mail server. The default value is false.

Namespace:  System.Net.Configuration
Assembly:  System (in System.dll)

[ConfigurationPropertyAttribute("enableSsl", DefaultValue = false)]
public bool EnableSsl { get; set; }

Property Value

Type: System.Boolean
true indicates that SSL will be used to access the SMTP mail server; otherwise, false.

The EnableSsl property indicates if SSL is used to access an SMTP mail server. The SmtpClient class only supports the SMTP Service Extension for Secure SMTP over Transport Layer Security as defined in RFC 3207. In this mode, the SMTP session begins on an unencrypted channel, then a STARTTLS command is issued by the client to the server to switch to secure communication using SSL. See RFC 3207 published by the Internet Engineering Task Force (IETF) for more information.

An alternate connection method is where an SSL session is established up front before any protocol commands are sent. This connection method is sometimes called SMTPS and by default uses port 465. This alternate connection method using SSL is not currently supported.

.NET Framework

Supported in: 4

.NET Framework Client Profile

Supported in: 4

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.