Código PHP:
$eol="\r\n";
$mime_boundary=md5(time());
$fromaddress = "[email protected]";
$fromname = "Mazikacafe";
$headers .= "From: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Reply-To: ".$fromname."<".$fromaddress.">".$eol;
$headers .= "Return-Path: ".$fromname."<".$fromaddress.">".$eol; // these two to set reply address
$headers .= "Message-ID: <".time()."-".$fromaddress.">".$eol;
$headers .= "X-Mailer: PHP v".phpversion().$eol; // These two to help avoid spam-filters
# Boundry for marking the split & Multitype Headers
$headers .= 'MIME-Version: 1.0'.$eol;
$headers .= "Content-Type: multipart/mixed; boundary=\"".$mime_boundary."\"".$eol.$eol;
$body = "Hello,\n\n To finalize your registration and activate your account, please click on the following URL:\n\n";
$body .= "http://www.mazikacafe.com/online/user/receivingActivation.php?id=$aleatorio\n\n";
$body .= "Thank you.\n";
# Open the first part of the mail
$msg = "--".$mime_boundary.$eol;
$htmlalt_mime_boundary = $mime_boundary."_htmlalt"; //we must define a different MIME boundary for this section
# Setup for text OR html -
$msg .= "Content-Type: multipart/alternative; boundary=\"".$htmlalt_mime_boundary."\"".$eol.$eol;
# Text Version
$msg .= "--".$htmlalt_mime_boundary.$eol;
$msg .= "Content-Type: text/plain; charset=iso-8859-1".$eol;
$msg .= "Content-Transfer-Encoding: 8bit".$eol.$eol;
$msg .= $body.$eol.$eol;
$msg .= "--".$htmlalt_mime_boundary."--".$eol.$eol;
$msg .= "--".$mime_boundary."--".$eol.$eol;
$subject = "SignUp new user";
if(mail($email,$subject,$msg,$headers)){
header("Location: http://www.mazikacafe.com/online/user/signupSended.php?email=".$email);
}
else{
$_SESSION['error'] = "There has been an error in sending its code activiacion, please try again. Thank you.";
header("Location: http://www.mazikacafe.com/online/user/signup.php");
}
}
German.