Email Validation

Validation is the process of determining if a value meets the acceptable criteria. Hygine is the process of correcting a value to meet the accepted criteria. The only hygine we do is removing of white spaces before and after an email. All other hygine should be done on the client side before submitting to the Emails or Subscribers service. Improperly formatted email addresses will be rejected with a 400 response.

We validate the case of emails, must be lower case, the syntax of the email and the top level domain (TLD).

The syntax and TLD validation are done using the Apache Commons validator.

Examples of valid Email address

  1. subs@yahoo.com, subs-100@yahoo.com, subs.100@yahoo.com
  2. subs111@subs.com, subs-100@subs.net, subs.100@subs.com.au
  3. subs@1.com, subs@gmail.com.com
  4. subs+100@gmail.com, subs-100@yahoo-test.com

Examples of invalid Email address

  1. subs – must contains “@” symbol
  2. subs@.com.my – tld can not start with dot “.”
  3. subs123@gmail.a – “.a” is not a valid tld, last tld must contains at least two characters
  4. subs123@.com – tld can not start with dot “.”
  5. subs123@.com.com – tld can not start with dot “.”
  6. .subs@subs.com – email’s first character can not start with dot “.”
  7. subs()*@gmail.com – email’s only allows character, digit, underscore and dash
  8. subs@%*.com – email’s tld only allows characters and digits
  9. subs..2002@gmail.com – double dots “.” are not allow
  10. subs.@gmail.com – email’s last character can not end with dot “.”
  11. subs@subs@gmail.com – double “@” is not allow
  12. subs@gmail.com.1a -email’s tld, which has two characters can not contain digits