Authenticates the user on a mail server using POP-before-SMTP authentication.
true if the method succeeds; otherwise, false.
This method can be used to authenticate the user on the SMTP server if the SMTP server itself does not support ESMTP authentication, but can use results of POP3 authentication performed against a POP3 server which shares the users accounts database with the given SMTP server (usually, this POP3 server is running on the same host where the SMTP server is running).
Note The developer can also enable automatic use of POP-before-SMTP authentication when connecting to the SMTP server by setting AuthPopBeforeSmtp property value to true. However, use of AuthPopBeforeSmtp method is more flexible, since AuthPopBeforeSmtp method can also be used in scenarios when the POP3 server name/account name/password is different from the corresponding parameters of the companion SMTP server.
| Exception Type | Condition |
|---|---|
| MailBeeException | An error occurred and ThrowExceptions is true. |
This samples performs POP-before-SMTP authentication on pop.domain.com host prior to connecting to the SMTP server at smtp.domain.com.
[C#] // To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.SmtpMail; // The actual code (put it into a method of your class) Smtp mailer = new Smtp(); mailer.SmtpServers.Add("smtp.domain.com"); mailer.AuthPopBeforeSmtp("pop.domain.com", 110, "jdoe", "secret"); mailer.Connect(); mailer.Disconnect();
[Visual Basic] ' To use the code below, import MailBee namespaces at the top of your code. Imports MailBee Imports MailBee.SmtpMail ' The actual code (put it into a method of your class) Dim mailer = New Smtp mailer.SmtpServers.Add("smtp.domain.com") mailer.AuthPopBeforeSmtp("pop.domain.com", 110, "jdoe", "secret") mailer.Connect() mailer.Disconnect()
Smtp Class | MailBee.SmtpMail Namespace | AuthPopBeforeSmtp