Topic: Re: Invalid emails
Karamasoft Support Forums

Page 1 of 1 (9 items)

Posted by Jackzzz on 05-01-2013 2:01 PM
In our onbeforesend function we validate the email address using the following code: Many of our emails are showing as invalid. Can you tell us why this might happen and how to prevent it?

If (val.ValidateEmailAddress(e.MergedMail.To(0).Address) <> ValidationLevel.Account) Then
' Cancel this particular email by setting SendMergedMail to false
e.SendMergedMail = False

Thank you very much.

Posted by Karamasoft on 05-01-2013 2:10 PM
It's because the SMTP and Account level checks depend on the SMTP server. Some servers return proper answers, while others just return true or false without checking at all. Therefore, you're unfortunately at the mercy of the servers.

Posted by Jackzzz on 05-01-2013 2:22 PM
So then, should we NOT do this check when sending smtp email?

Thank you,

Posted by Karamasoft on 05-01-2013 2:42 PM
As it's a very restrictive check, you may consider keeping your checks at the domain level rather than smtp or account. It's a trade-off between letting bad email addresses pass through and not letting good ones. You'll have to make a decision based on your business needs.

Posted by Jackzzz on 05-01-2013 3:15 PM
Sorry to need to ask this, but how would I keep the checks at the domain level, rather than smtp or account? Not sure what this means. But would very much like to know.

Thank you,

Posted by Karamasoft on 05-01-2013 3:41 PM
If you go to http://www.karamasoft.com/KnowledgeBase.aspx and open "Server-Side Developer API" under UltimateEmail, you'll see the UltimateEmailValidator.MaxValidationLevel property. If you check ValidationLevel you should see the followings:

Invalid: Email address is assumed "invalid" before checking.
Syntax: Check whether the "syntax" is valid based on "ValidationExpression".
Domain: Check whether the "domain" server has MX records.
SMTP: Check whether the "SMTP" server responds successfully.
Account: Check whether the email "account" exists on the SMTP server.

Posted by Jackzzz on 05-01-2013 4:07 PM
So if we are using Account level and the smtp server returns false is it possible that they would still deliver the email anyway, if we didn't tell our app to not send at this point?

We send smtp email through our asp.net app using ultimateemail, so it goes out through our apps site host. We have no way of knowing if it was delivered.

Or is there a way to know this?

Thank you,

Posted by Karamasoft on 05-01-2013 4:27 PM
Those validations have nothing to do with sending emails. You can send email to any address you like. It's only about validating an email address before saving it into your system when someone registers on your website.

Posted by Jackzzz on 05-01-2013 5:03 PM
Ok, so it sounds like we should not be validating when we send, got it.