Zip Component, Email Component, Encryption Component ActiveX Control for Zip Compression .NET Components for ASP.NET
ActiveX and .NET Components for Zip Compression, Encryption, Email, XML, S/MIME, HTML Email, Character Encoding, Digital Certificates, FTP, and more ASP Email ActiveX Component


Index of Chilkat Blog Posts

October 18, 2006

Email Address Verification

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 support@chilkatsoft.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.UnlockComponent("30-day trial");
	
		mailman.SmtpUsername = "mylogin@gmail.com";
		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 = "chilkat.support@gmail.com";
		email.AddTo("Matt","support@chilkatsoft.com");
		email.AddTo("Junk","akls8dfgkd@a8dsagas.asdsas88fdfkd.com");
		email.AddTo("kasdfas","8drsg8r**$$$");
	
		Chilkat.StringArray array = new Chilkat.StringArray();
	
		mailman.VerifyRecipients(email,array);
	
		mailman.SaveLastError("verifyLog.txt");
	
		// Print the bad email addresses.
		int i;
		int n = array.Count;
		for (i=0; i<n ; i++)
		{
		    listBox1.Items.Add(array.GetString(i));
		}
</font>


Privacy Statement. Copyright 2000-2011 Chilkat Software, Inc. All rights reserved.
Send feedback to support@chilkatsoft.com

Components for Microsoft Windows XP, 2000, 2003 Server, Vista, Windows 7, and Windows 95/98/NT4.