I have this script which sends an email for users to activate their accounts on my website, its working fine my only problem is that its sending the body of the message twice, Can anybody see and explain why?
$toemail = $_POST['produgg_email'];
// Send activation email
$to = $toemail;
$subject = "Website Activation";
$headers = "From: support@website\r\n" .
$body = "To activate your website.co.uk please click <a href='http://www.website.co.uk/activateuser.php?email=$toemail'>here</a>";
if (mail($to, $subject, $body, $headers)) {
echo("<p>Message successfully sent!</p>");
} else {
echo("<p>Message delivery failed...</p>");
}
You have pasted the code? If so, you have a dot instead of a ; at line 5...
精彩评论