Account confirmation email sent as SPAM :( PHP

Posted by praveen on Stack Overflow See other posts from Stack Overflow or by praveen
Published on 2010-03-20T06:20:06Z Indexed on 2010/03/20 6:21 UTC
Read the original article Hit count: 271

Filed under:
|
|

Hi,

I'm using PHPMailer to send a confirmation email for newly registered users in my social network. But i found out most of them have ended up in user's spam list. (hotmail and yahoo). How to avoid this?

This is my script

$mail=new PHPMailer();
$mail->IsSMTP();
$mail->SMTPAuth = mSMTPAuth(); 
$mail->SMTPSecure = mSMTPSecure(); 
$mail->Host = mHost(); 
$mail->Port = mPort(); 
$mail->Username = mUsername(); 
$mail->Password = mPassword(); 
$mail->From = mFrom();
$mail->FromName = "SiteName";
$mail->Subject = "SiteName New Account Activation";
$mail->IsHTML(true); 
$mail->WordWrap = 50;       

$mail->Body = "<h2>Welcome to " .$sitename. " " .$username. "! </h2><br><br>";

$mail->Body .= "Please click on the link below to verify your email address:<br><br>";
$mail->Body .= "<a href='".$base. "verify.php?a=" .$gen_key."'>".$base. "verify.php?a=" .$gen_key."</a>";


$mail->Body .= "<br><br>Regards<br>";


$mail->AltBody = "Welcome to " .$sitename. " " .$username. "!\n\nTo verify your email address, please click on the link below:\n\n".$base. "verify.php?a=" .$gen_key;

$mail->AddAddress($email);
$mail->Send();
$mail->ClearAddresses();

Please help. This is really confusing.

Thanks in advance

© Stack Overflow or respective owner

Related posts about php

Related posts about phpmailer