Share via


MailBindingBase.Security Property

[This documentation is for preview only, and is subject to change in later releases. Blank topics are included as placeholders.]

Gets the security object for the mail binding.

Namespace:  Microsoft.ServiceModel.Channels.Mail
Assembly:  Microsoft.ServiceModel.Channels.Mail (in Microsoft.ServiceModel.Channels.Mail.dll)

Syntax

'Declaration
Public ReadOnly Property Security As MailSecurity
    Get
'Usage
Dim instance As MailBindingBase
Dim value As MailSecurity

value = instance.Security
public MailSecurity Security { get; }
public:
property MailSecurity^ Security {
    MailSecurity^ get ();
}
member Security : MailSecurity

Property Value

Type: Microsoft.ServiceModel.Channels.Mail.MailSecurity
An object that represents the security configuration for the channel.

Remarks

By default, security is disabled. To enable security, use the Mode property of the MailSecurity object.

Examples

The following example shows how to enable message security for the mail binding. For the complete code example, see the MailSecurity class.

Dim binding As ExchangeWebServiceMailBinding
Dim clientEmailServer As New Uri("https://mail.example.com")
Dim clientEmailAddress As String = "client@example.com"
Dim password As String = "password"

binding = New ExchangeWebServiceMailBinding(clientEmailServer, New NetworkCredential(clientEmailAddress, password))
binding.Security.Mode = MailSecurityMode.Message
ExchangeWebServiceMailBinding binding;
Uri clientEmailServer = new Uri("https://mail.example.com");
string clientEmailAddress = "client@example.com";
string password = "password";

binding = new ExchangeWebServiceMailBinding(clientEmailServer,
                                           new NetworkCredential(clientEmailAddress, password));
binding.Security.Mode = MailSecurityMode.Message;

.NET Framework Security

Platforms

Windows CE, Windows Mobile for Smartphone, Windows Mobile for Pocket PC

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

Version Information

.NET Compact Framework

Supported in: 3.5

See Also

Reference

MailBindingBase Class

MailBindingBase Members

Microsoft.ServiceModel.Channels.Mail Namespace