PowerTCP Mail for .NET
Address Property
See Also  Send comments on this topic.
Dart.PowerTCP.Mail Namespace > MailAddress Class : Address Property




Gets this email in network format.

Syntax

Visual Basic (Declaration) 
Public ReadOnly Property Address As String
Visual Basic (Usage)Copy Code
Dim instance As MailAddress
Dim value As String
 
value = instance.Address
C# 
public string Address {get;}
Managed Extensions for C++ 
public: __property string* get_Address();
C++/CLI 
public:
property String^ Address {
   String^ get();
}

Property Value

The network format of the email address being sent to.

Example

The following example demonstrates the properties of a MailAddress object.
Visual BasicCopy Code
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail"
' at the top of your class.

' Create a new MailAddress, supplying the address and friendly name.
Dim ma As New MailAddress("""Fake Name"" test@dart.com")
Debug.WriteLine("Network formatted address: " + ma.Address)
Debug.WriteLine("Domain of the address: " + ma.Domain)
Debug.WriteLine("Friendly name: " + ma.Friendly)
Debug.WriteLine("User name: " + ma.User)
Debug.WriteLine("All address data: " + ma.ToString());

' Output
' --------------------------------
' Network formatted address: <test@dart.com>
' Domain of the address: dart.com
' Friendly name: Fake Name
' User name: test
' All address data: "Fake Name" <test@dart.com>
C#Copy Code
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;"
// at the top of your class.

// Create a new MailAddress, supplying the address and friendly name.
MailAddress ma = new MailAddress("\"Fake Name\" test@dart.com");
Debug.WriteLine("Network formatted address: " + ma.Address);
Debug.WriteLine("Domain of the address: " + ma.Domain);
Debug.WriteLine("Friendly name: " + ma.Friendly);
Debug.WriteLine("User name: " + ma.User);
Debug.WriteLine("All address data: " + ma.ToString())

// Output
// --------------------------------
// Network formatted address: <test@dart.com>
// Domain of the address: dart.com
// Friendly name: Fake Name
// User name: test
// All address data: "Fake Name" <test@dart.com>

Remarks

This returns the email address in brackets, without the friendly name. For example, if the following code was run,

MailAddress m = new MailAddress("\"Bob Test\" bob@myserver.com");

MailAddress.Address would be "<bob@myserver.com>".

If the original email address passed into the constructor could not be parsed, this property will return that entire value.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

Documentation Version 3.2
© 2010 Dart Communications. All Rights Reserved.