SMTP authentication |
Some SMTP servers require that you provide username/password authentication to allow you to send email. This is typically used to prevent unauthorized users from using the SMTP server as a relay for sending spam.
After establishing a connection with an SMTP server you can login by invoking the Login method of an Smtp instance providing your username and password as arguments.
Example
[C#] Smtp smtp = new Smtp("smtp.myserver.com"); smtp.Connect(); // login smtp.Login("jsmith","secret");
[Visual Basic] Dim mySmtp As Smtp = Nothing mySmtp = New Smtp("smtp.myserver.com") mySmtp.Connect() ' login mySmtp.Login("jsmith", "secret")
|