Author |
|
pfrigge Newbie
Joined: 24 May 2019
Online Status: Offline Posts: 3
|
Posted: 24 May 2019 at 4:00am | IP Logged
|
|
|
Hi,
we don't have the address validator licensed, but I'm posting in this thread since I assume, that MailBee.SmtpMail.Smtp.ValidateEmailAddressSyntax("address@example.com") uses the same code internally. This function returns false for addresses that actually exist but have the following structure: a.b.-test@t-online.de
A period followed by a hyphen (and also the other way around) seems to be the problem. But as I already mentioned, there are existing addresses using this format and all online verification services that I tested confirmed that such addresses actually are valid.
So is it possible to modify the regex check? This is a really big issue for us because we can't explain to our customers that this address gets rejected because it's to "strange" though it exists.
|
Back to Top |
|
|
Alex AfterLogic Support
Joined: 19 November 2003
Online Status: Offline Posts: 2206
|
Posted: 24 May 2019 at 6:55am | IP Logged
|
|
|
Hi,
Edge cases are up to the developer's liking. There is no strict rule in this situations so you can easily tweak the this behavior by adjusting EmailAddressValidator.RegexPattern. It's default value is the most commonly accepted pattern of an email address but you can edit it (it's read/write property) how you see fit. For instance, you can use less strict and more forgiving pattern like ".+@.+".
Note that there is no such property for Smtp.ValidateEmailAddressSyntax method (it's simply not needed because the method is very simple and just calls Regex.IsMatch). So you can call Regex.IsMatch against your own pattern.
Regards,
Alex
|
Back to Top |
|
|
pfrigge Newbie
Joined: 24 May 2019
Online Status: Offline Posts: 3
|
Posted: 03 June 2019 at 2:25am | IP Logged
|
|
|
Hi,
we decided to omit the syntax validation in our sending process because the smtp server will reject invalid recipients anyway.
And for editing email addresses we will probably use a less strict regex pattern as you suggested.
Thanks!
|
Back to Top |
|
|