Checks an email address for validity at the requested level.
Language:
<!-- Import the Integr8 Ajax API -->
<!-- NOTE: Get your own API key to use in the following script tag from: -->
<!-- http://www.data-8.co.uk/integr8/Admin/Ajax.aspx -->
<script src="http://webservices.data-8.co.uk/Javascript/Loader.ashx?key=your-api-key" type="text/javascript">
</script>
<script type="text/javascript">
function loadIntegr8() {
// Load the EmailValidation Integr8 service
data8.load('EmailValidation');
}
function IsValid(email, level) {
/// <param name="email">string</param>
/// <param name="level">string. One of the following values: Syntax, MX, Server, Address</param>
var emailvalidation = new data8.emailvalidation();
emailvalidation.isvalid(
email,
level,
null,
showIsValidResult
);
}
function showIsValidResult(result) {
// Check that the call succeeded, and show the error message if there was a problem.
if (!result.Status.Success) {
alert('Error: ' + result.Status.ErrorMessage);
}
else {
// TODO: Process method results here.
// Results can be extracted from the following fields:
// result.Result
// Contains a status code indicating if the email address could be validated.
}
}
loadIntegr8();
</script>
// NOTE: A reference to the web service must be added in Visual Studio with the URL
// http://webservices.data-8.co.uk/EmailValidation.asmx
private void IsValid(string email, EmailValidationLevel level)
{
// Invoke the web service method.
EmailValidation proxy = new EmailValidation();
EmailValidationOutput results = proxy.IsValid("username", "password", email, level, null);
// Check that the call succeeded, and show the error message if there was a problem.
if ((results.Status.Success == false))
{
MessageBox.Show(("Error: " + results.Status.ErrorMessage));
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// result.Result
// Contains a status code indicating if the email address could be validated.
}
}
'NOTE: A reference to the web service must be added in Visual Studio with the URL
'http://webservices.data-8.co.uk/EmailValidation.asmx
Private Sub IsValid(ByVal email As String, ByVal level As EmailValidationLevel)
'Invoke the web service method.
Dim proxy As EmailValidation = New EmailValidation()
Dim results As EmailValidationOutput = proxy.IsValid("username", "password", email, level, Nothing)
'Check that the call succeeded, and show the error message if there was a problem.
If (results.Status.Success Is false) Then
MessageBox.Show(("Error: " + results.Status.ErrorMessage))
Else
'TODO: Process method results here.
'Results can be extracted from the following fields:
'result.Result
' Contains a status code indicating if the email address could be validated.
End If
End Sub
Public Sub IsValid(email As String, level As String)
Dim rs As ADODB.Recordset
Set rs = New ADODB.Recordset
rs.Open "http://webservices.data-8.co.uk/recordset.ashx?service=EmailValidation&method=IsValidSimple" &
"&username=your-username" &
"&password=your-password" &
"&email=" & email &
"&level=" & level
If rs.MoveFirst Then
If rs.Fields(0).Name = "Success" And rs.Fields(0).Value = false Then
MsgBox "Error: " & rs.Fields(1)
Else
'TODO: Process method results here.
'All the results are available in the first row in the recordset.
'Results can be extracted from the following fields:
'Result
' Contains a status code indicating if the email address could be validated.
End If
End If
End Sub
// NOTE: The php_soap.dll extension must be enabled in the php.ini file.
function IsValid($email, $level)
{
$params = array(
"username" => "your-username",
"password" => "your-password",
"email" => $email,
"level" => $level,
"options" => $options
);
$client = new SoapClient("http://webservices.data-8.co.uk/EmailValidation.asmx?WSDL");
$result = $client->IsValid($params);
if ($result->IsValidResult->Status->Success == 0)
{
echo "Error: " . $result->IsValidResult->Status->ErrorMessage;
}
else
{
// TODO: Process method results here.
// Results can be extracted from the following fields:
// $result->IsValidResult->Result
// Contains a status code indicating if the email address could be validated.
}
}