-3
$result=mysql_query($sql);
if($result)
{
// ---------------- SEND MAIL FORM ----------------

// send e-mail to ...
$to=$email;
// Your subject
$subject="Your confirmation link here";
// From
$header="from: Welcome to gvmgvhgvmhgm <info@hgfgfcjhgv.com>";
// Your message
$message="Your Comfirmation link \r\n";
$message.="Click on this link to activate your account \r\n";
$message.="Welcome to dtnhngg .com .. Make your journey more comfortbale";
$mailedby="mailed-by: jfncghjnhgn.com";

// send email
$sentmail = mail($to,$subject,$message,$header,$mailedby);
if($sentmail){
echo "Your Confirmation link Has Been Sent To Your Email Address.";
}

die(mysql_error());

mysql_close();

?>

i m using this code to send mail ... But my mails are going directly to the spam folder .. Any help regarding this ???

IT gIrLy GiRl
  • 337
  • 4
  • 7
  • 20

2 Answers2

0

You should make sure that your e-mail contains the right headers (like MIME-Version and Content-Type). Furthermore, since you're sending a HTML e-mail, you should include a full HTML document in $message with <!DOCTYPE>, <html>, <body> and so on.

The spam-filter might be giving your e-mail a higher spam-rating because of these issues.

After that, if you still have problems, check Why is my e-mail still being picked up as spam? Using mail() function as @Amal Murali suggests.

Community
  • 1
  • 1
Lasse
  • 1,414
  • 11
  • 19
0

Add this code to headers

$headers  .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
Shiva Saurabh
  • 1,281
  • 2
  • 25
  • 47
Ganesan
  • 1
  • 1