SmtpClient.TestRecipientsAsync Method


Tests if specified SMTP server accepts an e-mail address.

[Visual Basic]
Public Sub TestRecipientsAsync( _
    server As SmtpServer, _
    mail As SmtpMail _
) As IAsyncAction
[C#]
public IAsyncAction TestRecipientsAsync(
    SmtpServer server,
    SmtpMail mail
);
[C++]
public: IAsyncAction^ TestRecipientsAsync(
    SmtpServer^ server,
    SmtpMail^ mail
);
[JScript]
public function TestRecipientsAsync( 
    server : SmtpServer, 
    mail : SmtpMail
): IAsyncAction;

Parameters

server
A SmtpServer instances used to test.
mail
A SmtpMail instance to test.

Return Value

An IAsyncAction interface instance to represents an asynchronous action, you can use this return object to cancel current operation.

Remarks

How does it work? Firstly, SmtpClient will try to connect to this server. SmtpClient then performs "RCPT TO" command to test if this SMTP server accept this email address.