Simple mail validation


(Sibert) #1

I am trying to get email validation to work. So far I have done it in three levels. Format, tld, domain and not allow certain domains.

https://play.golang.org/p/5qCSq3PNgU4

It seems that the format regexp is not working correct.

My question is it this can be done in a smarter and simpler way?


(Norbert Melzer) #2

You should not use a regular expression ta validate emails…

Just check if you have a local part, an @ and a domain.

Then check if there is an MX record available for that domain, then send the verification email.

This is the only way to check if an email address is valid and does actually exist.

If though you want to use a regex, then give https://stackoverflow.com/questions/201323/how-to-validate-an-email-address-using-a-regular-expression a read.


(Sibert) #3

https://play.golang.org/p/k3r4oADGEKp

Sufficiently?


(Tanjaddaniel) #4

Can anybody tell me what’s happening with my Roadrunner Email, because it shows me an error with a message Roadrunner Email Not Working is it happening due to the updation ?


(system) closed #5

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.