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
public IAsyncAction TestRecipientsAsync(
    SmtpServer server,
    SmtpMail mail
public: IAsyncAction^ TestRecipientsAsync(
    SmtpServer^ server,
    SmtpMail^ mail
public function TestRecipientsAsync( 
    server : SmtpServer, 
    mail : SmtpMail
): IAsyncAction;


A SmtpServer instances used to test.
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.


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.