aspNetEmail

EmailMessage.SmtpAuthentication Property

Authentication mechanism used against the SMTP server.

public SmtpAuthentication SmtpAuthentication {get; set;}

Remarks

By default EmailMessage.SmtpAuthentication = SmtpAuthentication.AuthLogin

Example

[C#]
            EmailMessage msg = new EmailMessage( "mail.myCompany.com");
            msg.Subject = "Order Confirmation";
            msg.To = "you@yourcompany.com";
            
            msg.From = "me@myCompany.com";
            
            //logging for easier troubleshooting
            msg.Logging = true;
            msg.LogPath = "c:\\email.log";
            
            //set the plain text body
            msg.Body  = "the email body contents go here...";
            
            //set the authentication
            msg.SmtpAuthentication = SmtpAuthentication.AuthLogin;
            msg.Username = "username";
            msg.Password = "secret";
            
            msg.Send();
            
            
[VB.NET]
            
            Dim msg As New EmailMessage("mail.myCompany.com")
            
            msg.Subject = "Order Confirmation"
            msg.To = "you@yourcompany.com"
            
            msg.From = "me@myCompany.com"
            
            'logging for easier troubleshooting
            msg.Logging = True
            msg.LogPath = "c:\email.log"
            
            'set the plain text body
            msg.Body = "the email body contents go here..."
            
            'set the authentication
            msg.SmtpAuthentication = SmtpAuthentication.AuthLogin
            msg.Username = "username"
            msg.Password = "secret"
            
            msg.Send()
            
            

See Also

EmailMessage Class | aspNetEmail Namespace