共用方式為


MailUriHelper Class

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

Provides helper functions for creating mail Uniform Resource Identifiers (URIs) or accessing data from mail URIs.

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

Syntax

'Declaration
Public NotInheritable Class MailUriHelper
'Usage
Dim instance As MailUriHelper
public sealed class MailUriHelper
public ref class MailUriHelper sealed
[<SealedAttribute>]
type MailUriHelper =  class end

Remarks

The mail URI includes a channel name and an e-mail address. The mail URI is based on the following format:

net.mail://<channel-name>#<e-mail-address-1>;...;<e-mail-address-n>

Note

This class is included with the .NET Compact Framework version 3.5, but it requires either the .NET Compact Framework 3.5 or the .NET Framework version 3.0 or later at run time.

Examples

The following example shows how to use the MailUriHelper class to create Uri objects. The URIs are used as parameters in calls to the BuildChannelListener<TChannel> and CreateChannel methods.

bpc = New BindingParameterCollection()

factory = binding.BuildChannelFactory(Of IOutputChannel)(bpc)
listener = binding.BuildChannelListener(Of IInputChannel)(MailUriHelper.CreateUri(ChannelName, ""))

factory.Open()
output = factory.CreateChannel(New EndpointAddress(MailUriHelper.Create(ChannelName, DestinationEmailAddress)))
bpc = new BindingParameterCollection();

factory = binding.BuildChannelFactory<IOutputChannel>(bpc);
listener = binding.BuildChannelListener<IInputChannel>(MailUriHelper.CreateUri(ChannelName, ""), bpc);

factory.Open();
output = factory.CreateChannel(new EndpointAddress(MailUriHelper.Create(ChannelName, DestinationEmailAddress)));

Inheritance Hierarchy

System.Object
  Microsoft.ServiceModel.Channels.Mail.MailUriHelper

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.

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

MailUriHelper Members

Microsoft.ServiceModel.Channels.Mail Namespace