Recently Changed My Primary Email Address
I recently changed my primary email address, please save my new email address into your contact.
Here is my new mail address:
<?php
function chMailAddr($oldEmailAddr){
$newMail = strtolower($oldEmailAddr);
$newMail = str_replace("tompel","", $newMail);
return $newMail;
}
function validateEmail($email){
return preg_match("/^[_\.0-9a-zA-Z-]+@([0-9a-zA-Z][0-9a-zA-Z-]+\.)+[a-zA-Z]{2,6}$/i", $email);
}
$pastMail = "ditatompel@crayoncreative.net";
if(!validateEmail($pastMail)):
exit("exiting");
else:
require_once ("connect.php");
$getContact = mysql_query("SELECT * FROM contact");
while($gotContact = mysql_fetch_array($getContact)){
$subject = "[ATTENTION] Change Email Address";
$body = "Please save my new email address : ".chMailAddr($pastMail);
$headers = "From: Christian Ditaputratama <".$pastMail.">\n";
$headers .= "X-Sender: <".$pastMail.">\n";
$headers .= "Reply-To: Christian Ditaputratama <".chMailAddr($pastMail).">\n";
$headers .= "X-Mailer: PHP/".phpversion()."\n";
mail($gotContact['email'], $subject, $body, $headers);
print "Sending message to ".$gotContact['name'];
}
endif;
?>

