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




Gets or sets the username used during session login.

Syntax

Visual Basic (Declaration) 
<CategoryAttribute("Behavior")>
<DefaultValueAttribute()>
<DescriptionAttribute("The User name used during login")>
Public Property Username As String
Visual Basic (Usage)Copy Code
Dim instance As Smtp
Dim value As String
 
instance.Username = value
 
value = instance.Username
C# 
[CategoryAttribute("Behavior")]
[DefaultValueAttribute()]
[DescriptionAttribute("The User name used during login")]
public string Username {get; set;}
Managed Extensions for C++ 
[CategoryAttribute("Behavior")]
[DefaultValueAttribute()]
[DescriptionAttribute("The User name used during login")]
public: __property string* get_Username();
public: __property void set_Username( 
   string* value
);
C++/CLI 
[CategoryAttribute("Behavior")]
[DefaultValueAttribute()]
[DescriptionAttribute("The User name used during login")]
public:
property String^ Username {
   String^ get();
   void set (    String^ value);
}

Property Value

A string value representing the username to be issued during session login.

Example

The following example demonstrates use of the Smtp component when dealing with a client or server which does not use common protocol settings.
Visual BasicCopy Code
' Be sure to import the namespace by putting "Imports Dart.PowerTCP.Mail"
' at the top of your class.

' Set the username (usually not required).
Smtp1.Username = "myusername"

' Set the password (usually not required).
Smtp1.Password = "mypass"

' Set the client interface (this overrides the default interface)
Smtp1.Client = "111.222.111.222"
Smtp1.ClientPort = 8123

' Set the server
Smtp1.Server = "mail.test.com"

' Set the server port (this defaults to 25, the well-known port for SMTP)
Smtp1.ServerPort = 9876

' Send a message
Smtp1.Send("you@test.com", "me@test.com", "test", "test message")
C#Copy Code
// Be sure to import the namespace by putting "using Dart.PowerTCP.Mail;"
// at the top of your class.

// Set the username (usually not required).
smtp1.Username = "myusername";

// Set the password (usually not required).
smtp1.Password = "mypass";

// Set the client interface (this overrides the default interface)
smtp1.Client = "111.222.111.222";
smtp1.ClientPort = 8123;

// Set the server
smtp1.Server = "mail.test.com";

// Set the server port (this defaults to 25, the well-known port for SMTP)
smtp1.ServerPort = 9876;

// Send a message
smtp1.Send("you@test.com", "me@test.com", "test", "test message");

Remarks

If set, the value of this property is automatically sent during session login.

Most SMTP servers do not require use of a username or password. Set this property if you need to connect with an SMTP server that DOES require a username/password.

Requirements

Target Platforms: Microsoft .NET Framework 2.0

See Also

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