Simple mail validation

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?

1 Like

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.

2 Likes

Sufficiently?

1 Like

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 ?

1 Like

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