47 lines
1.3 KiB
PHP
47 lines
1.3 KiB
PHP
<?php header('Content-type: application/json');
|
|
require_once('smtp_validate.class.php');
|
|
if ( !defined('PATHTOINCLUDES') ) define('PATHTOINCLUDES', $_SERVER["DOCUMENT_ROOT"] . '/mailservices/includes/');
|
|
include(PATHTOINCLUDES."base.php");
|
|
$dconn=dbconnect2();
|
|
$msg="";
|
|
// the email to validate
|
|
//$email = 'porembaphilip@gmail.com';
|
|
if(isset($_GET["emailaddress"]))
|
|
{
|
|
$email=$_GET["emailaddress"];
|
|
}
|
|
else
|
|
{
|
|
//exit();
|
|
}
|
|
//echo "turned off";
|
|
//exit();
|
|
|
|
|
|
|
|
|
|
// an optional sender
|
|
$sender = 'host@bateworld.com';
|
|
// instantiate the class
|
|
$SMTP_Validator = new SMTP_validateEmail();
|
|
// turn on debugging if you want to view the SMTP transaction
|
|
$SMTP_Validator->debug = false;
|
|
// do the validation
|
|
$results = $SMTP_Validator->validate(array($email), $sender);
|
|
// view results
|
|
//echo $email.' is '.($results[$email] ? 'valid' : 'invalid')."\n";
|
|
// send email?
|
|
if ($results[$email]) {
|
|
$msg="cool";
|
|
$sqlup="UPDATE se_users SET user_pdp_evc = 1 WHERE user_email = '".$email."'";
|
|
$rup = mysql_query($sqlup) or $em=$em.mysql_error();
|
|
//mail($email, 'Confirm Email', 'Please reply to this email to confirm', 'From:'.$sender."\r\n"); // send email
|
|
} else {
|
|
$sqldown="UPDATE se_users SET user_pdp_evc = 0 WHERE user_email = '".$email."'";
|
|
$rdown = mysql_query($sqldown) or $em=$em.mysql_error();
|
|
$msg="not cool";
|
|
}
|
|
$arr = array ('result'=>$msg);
|
|
echo json_encode($arr);
|
|
exit();
|
|
?>
|