I add only a short comment to Jason's reply.
is better to check if the field has value or it will throw an error if you do indexOf of an empty field.
if (Xrm.Page.getAttribute("emailaddress1").getValue() != null) { ... }
and use "@domain.com", to don't stop email as domain.com@gmail.com for example