Verification of e-mail before sending

3

I have the following page link to contact a website. Sometimes people type the wrong email field, which prevents me from replying to it. Is there a verification of this field to confirm the existence of this email?

It can be a plugin because I use Wordpress.

    
asked by anonymous 15.09.2014 / 18:47

2 answers

3

You can connect to the server, and issue a VRFY command. Very few servers support this command, but it's just for that. If the server responds with a 2.0.0 DSN, the user exists.

VRFY user

You can issue a RCPT, and see if the email is rejected.

MAIL FROM:<>

RCPT TO:<user@domain>

If the user does not exist, you will have a DSN 5.1.1. However, just because the email is not rejected does not mean that the user exists. Some server will silently discard requests like this to prevent enumeration of their users. Other servers can not verify the user, and must accept the message independently.

    
15.09.2014 / 18:58
-1

@Otto's answer is show; it is good to check if the account exists. I find the check with incomplete / insufficient regular expression, though it is heavily used.

One of the validations I use is:

\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*

Regular Expression Tester

This validation is therefore simple. It matches [anyString] @ [anyString]. [AnyString]

    
15.09.2014 / 19:44