A new method will soon be added to the Chilkat Mailman class: VerifyRecipients. Here is an example in C#, with an explanation:
If you would like a pre-release with this new functionality, send email to email@example.com.
Verify email address via an SMTP session with the mailman.VerifyRecipients method.
Setup your mailman and email just like you normally would. Instead of calling SendEmail,
call VerifyRecipients to connect to the SMTP server and start the mail sending session.
In the SMTP protocol, "RCPT TO" commands are sent to the SMTP server, one per email address.
For each "RCPT TO" failure response, the email address is recorded in the output Chilkat.StringArray.
The SMTP session is aborted right after the final "RCPT TO" command, and prior to sending the "DATA"
command. Thus, the email is never sent. Your program may then examine the bad email addresses
and take appropriate action. Note: Some SMTP servers may accept *anything* for a "RCPT TO" argument,
and the level of email address checking varies with different SMTP servers.
<font face=courier size=1>
Chilkat.MailMan mailman = new Chilkat.MailMan();
mailman.SmtpUsername = "firstname.lastname@example.org";
mailman.SmtpPassword = "mypassword";
mailman.SmtpHost = "smtp.gmail.com";
mailman.SmtpPort = 465;
mailman.SmtpSsl = true;
Chilkat.Email email = new Chilkat.Email();
email.Subject = "this is a test";
email.Body = "This is a test…";
email.From = "email@example.com";
Chilkat.StringArray array = new Chilkat.StringArray();
// Print the bad email addresses.
int n = array.Count;
for (i=0; i<n ; i++)