Verifying an e-mail address

Problem

You need to make sure that an e-mail address obtained in a questionnaire is valid.

Solution

Use the test_email_address function in a CALCUL question.

Discussion

Getting e-mail addresses as part of Web data collection or telephone surveys is notoriously error-prone. The test_email_address function verifies whether a given e-mail address is (probably) deliverable. This function requires that the Net::Telnet Perl module be installed on the server. Calling this function is as simple as:

    ATEST = test_email_address($AEMAILADDRESS)

where ATEST is the open-end part that contains the result of the test and AEMAILADDRESS is the name of the open-end part containing the e-mail address.

The function returns one of the following codes. The CallWeb script can then branch to the appropriate next place in the questionnaire using habitual flow control tools like branching and display conditions.

test_email_address return codes
CodeMeaning
-2There is no mail (MX) server for the domain name of the e-mail address.
-1Net:Telnet is not installed on the server.
0The e-mail address is invalid.
1The e-mail address appears valid.
2The e-mail address appears valid but it is on a Microsoft Exchange server and, therefore, the result may be questionnable.

 

Verifying an e-mail address

Problem

You need to make sure that an e-mail address obtained in a questionnaire is valid.

Solution

Use the test_email_address function in a CALCUL question.

Discussion

Getting e-mail addresses as part of Web data collection or telephone surveys is notoriously error-prone. The test_email_address function verifies whether a given e-mail address is (probably) deliverable. This function requires that the Net::Telnet Perl module be installed on the server. Calling this function is as simple as:

    ATEST = test_email_address($AEMAILADDRESS)

where ATEST is the open-end part that contains the result of the test and AEMAILADDRESS is the name of the open-end part containing the e-mail address.

The function returns one of the following codes. The CallWeb script can then branch to the appropriate next place in the questionnaire using habitual flow control tools like branching and display conditions.

test_email_address return codes
CodeMeaning
-2There is no mail (MX) server for the domain name of the e-mail address.
-1Net:Telnet is not installed on the server.
0The e-mail address is invalid.
1The e-mail address appears valid.
2The e-mail address appears valid but it is on a Microsoft Exchange server and, therefore, the result may be questionnable.