SmtpAuthPopBeforeSmtp Method |
Authenticates the user on a mail server using POP-before-SMTP authentication.
Namespace: MailBee.SmtpMailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public bool AuthPopBeforeSmtp(
string pop3ServerName,
int pop3ServerPort,
string pop3AccountName,
string pop3Password
)
Public Function AuthPopBeforeSmtp (
pop3ServerName As String,
pop3ServerPort As Integer,
pop3AccountName As String,
pop3Password As String
) As Boolean
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:
Booleantrue if the method succeeds; otherwise,
false.
Exceptions 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(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.
using MailBee;
using MailBee.SmtpMail;
Smtp mailer = new Smtp();
mailer.SmtpServers.Add("smtp.domain.com");
mailer.AuthPopBeforeSmtp("pop.domain.com", 110, "jdoe", "secret");
mailer.Connect();
mailer.Disconnect();
Imports MailBee
Imports MailBee.SmtpMail
Dim mailer = New Smtp
mailer.SmtpServers.Add("smtp.domain.com")
mailer.AuthPopBeforeSmtp("pop.domain.com", 110, "jdoe", "secret")
mailer.Connect()
mailer.Disconnect()
See Also