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

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public bool AuthPopBeforeSmtp(
	string pop3ServerName,
	int pop3ServerPort,
	string pop3AccountName,
	string pop3Password
)

Parameters

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

Return Value

Type: Boolean
true if the method succeeds; otherwise, false.
Exceptions
ExceptionCondition
MailBeeExceptionAn error occurred and ThrowExceptions is true.
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 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(String, Int32, String, String) method is more flexible, since AuthPopBeforeSmtp(String, Int32, String, String) 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.
Examples
This samples performs POP-before-SMTP authentication on pop.domain.com host prior to connecting to the SMTP server at smtp.domain.com.
// 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();
See Also