MailBee.NET Objects 3.1

Smtp.AuthPopBeforeSmtp Method 

Authenticates the user on a mail server using POP-before-SMTP authentication.

public bool AuthPopBeforeSmtp(
   string pop3ServerName,
   int pop3ServerPort,
   string pop3AccountName,
   string pop3Password
);

Parameters

pop3ServerName
The host name or IP address of the POP3 server.
pop3ServerPort
The port on which POP3 service is running.
pop3AccountName
The user account name on the POP3 server.
pop3Password
The user account password on the POP3 server.

Return Value

true if the method succeeds; otherwise, false.

Remarks

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.

Exceptions

Exception Type Condition
MailBeeException An error occurred and ThrowExceptions is true.

Example

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()

See Also

Smtp Class | MailBee.SmtpMail Namespace | AuthPopBeforeSmtp