login about faq

Howdy,

I'd like to know if chilkat has any class/method to validate the address, for example:

kkk dd@domain.tld <= should return false for validation kkk-dd@domain.tld <= should return true ççç-dd@domain.tld <= should return false

Jorge,

asked Jun 25 at 16:52

jasb's gravatar image

jasb
1123


link

answered Jun 26 at 10:22

TracyP's gravatar image

TracyP
1213

Perfect email address validation is impossible. Some people want syntactic validation, but as Tracy indicated in the link above, there is really no way to do that because there are situations where the "email address" could be a distribution list, an x400 email address, etc. Maybe your app just wants to make sure there's an "@" symbol followed by what looks like a domain..

The other validation is when you contact the SMTP server that owns the email address and you begin an SMTP session and issue the "RCPT TO" command -- to see how the SMTP server responds. For example, maybe you contact smtp.xyz.com for email addresses ending in "xyz.com". The smtp.xyz.com can only know about the email accounts under its control. smtp.xyz.com would know nothing about gmail.com email addresses, or chilkatsoft.com email addresses. Furthermore, there are two problems with trying to validate an email address in this way:

  1. Most SMTP servers won't want to provide this information, which helps spammers determine what are valid/invalid addresses. They'll just respond to the "RCPT TO" command with a success response status, and allow for the email to continue. Then.. afterwards, an NDR may or may not be sent.
  2. Initiating an SMTP sesssion and then stopping prematurely is bad practice and can get your IP address banned for suspicious spammer-like activity.

Basically, for email address validation, my answer is: fuggedaboutit

Have a process in place to handle the NDRs (bounce messages) to update your lists.

link

answered Jun 26 at 10:36

chilkat's gravatar image

chilkat ♦♦
12.8k317366477

Hi,

I just want to validade the address, not againts the servers.

The's so many functions on the web and regex's for it, but all fail some stuff. For example there's the .net way, which fails for me, even that is valid, that is allowing spaces in the local part. MS Way:

Dim mailAddress As MailAddress Try mailAddress = New MailAddress("testing@invalid@email.com") Catch ex As Exception 'Invalid email End Try

link

answered Jun 26 at 11:56

jasb's gravatar image

jasb
1123

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×200
×4

Asked: Jun 25 at 16:52

Seen: 458 times

Last updated: Jun 26 at 11:56

powered by OSQA