Share via


MailUriHelper.CreateUri Method (String, array<String[])

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

Creates a Uri object that represents a mail Uniform Resource Identifier (URI) based on a specified channel and set of e-mail addresses.

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

Syntax

'Declaration
Public Shared Function CreateUri ( _
    channelName As String, _
    emailAddresses As String() _
) As Uri
'Usage
Dim channelName As String
Dim emailAddresses As String()
Dim returnValue As Uri

returnValue = MailUriHelper.CreateUri(channelName, _
    emailAddresses)
public static Uri CreateUri(
    string channelName,
    string[] emailAddresses
)
public:
static Uri^ CreateUri(
    String^ channelName, 
    array<String^>^ emailAddresses
)
static member CreateUri : 
        channelName:string * 
        emailAddresses:string[] -> Uri 

Parameters

  • channelName
    Type: System.String
    The channel name to use in the mail URI. Do not use the following characters in the channel name: number sign (#), equal sign (=), semicolon (;), or space (" ").
  • emailAddresses
    Type: array<System.String[]
    An array that contains the e-mail addresses to use in the mail URI. Display names are not supported in e-mail addresses. An example of a valid e-mail address is "someone@example.com".

Return Value

Type: System.Uri
An object that represents the mail URI that is created.

Exceptions

Exception Condition
ArgumentException

The channel name or e-mail addresses are formatted incorrectly or contain invalid characters.

ArgumentNullException

The Uri object is nulla null reference (Nothing in Visual Basic).

UriFormatException

The Uri object is formatted incorrectly. See the Uri constructors for the correct format.

Remarks

This method creates a mail Uri object in the following format:

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

The e-mail address is used only by the output channel.

Pass the returned Uri object as a parameter in calls to the BuildChannelListener<TChannel> and CreateChannel methods.

Examples

For an example that shows how to use this method with a single e-mail address, see the CreateUri(String, String) method overload.

.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

MailUriHelper Class

MailUriHelper Members

CreateUri Overload

Microsoft.ServiceModel.Channels.Mail Namespace