Files
Testing/phil/mail/smtp_validate_bak_dnscheck.php
sean 0e8a8b3028
Some checks are pending
deploy-testing / deploy (push) Waiting to run
Initial testing snapshot
2026-11-17 16:15:01 -05:00

66 lines
1.7 KiB
PHP

<?php
require_once('smtp_validate.class.php');
$msg="";
// the email to validate
//$email = 'porembaphilip@gmail.com';
if(isset($_GET["emailaddress"]))
{
$email=$_GET["emailaddress"];
}
else
{
//exit();
}
function checkEmail($email) {
if(eregi("^[_a-z0-9-]+(\.[_a-z0-9-]+)*@[a-z0-9-]+(\.[a-z0-9-]+)*(\.[a-z]{2,4})$", $email)){
list($username,$domain)=split('@',$email);
if(!checkdnsrr($domain,'MX')) {
return false;
}
return true;
}
return false;
}
function dbconnect2()
{
$emsg="Ok";
$mhostname = "66.85.148.34";
$mdatabase = "bateworld";
$musername = "dolphin";
$mpassword = "dolphin";
mysql_connect($mhostname, $musername, $mpassword) or $emsg="Host Connect Error";
if($emsg=="Ok"){mysql_select_db($mdatabase) or $emsg="Database Connection Error";}
return($emsg);
}
$dbcon=dbconnect2();
$sql="SELECT `se_users`.`user_id`,
`se_users`.`user_email`
FROM `se_users`
WHERE 1>0
ORDER BY `se_users`.`user_id` DESC LIMIT 5000 OFFSET 30000";
$result= mysql_query($sql) or $em=$em.mysql_error();
while ($row = mysql_fetch_assoc($result)) {
$email=trim($row["user_email"]);
$testemail=checkEmail($email);
if ($testemail) {
$sqlup="UPDATE se_users SET user_pdp_evc = 1 WHERE user_email = '".$email."'";
//$rup = mysql_query($sqlup) or $em=$em.mysql_error();
echo "<div>".$row["user_email"]." ".$row["user_id"]." cool</div>";
//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 = '".$row["user_email"]."'";
$rup = mysql_query($sqldown) or $em=$em.mysql_error();
echo "<div>".$row["user_email"]." ".$row["user_id"]." not cool</div>";
}
}
exit();
?>