Click here to Skip to main content
16,020,186 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
my php mails ie confirmation mail always go in spam folder, but when i mark hat mail as NOT SPAM, php confirmation mail never comes in inbox or in spam. What to do, please help

What I have tried:

$to = $email;
$subject = "Verify your account ";

$body = "Dear $name



$header = "From:admin@xyz.com \r\n";
//$header .= "Cc:afgh@somedomain.com \r\n";
$header .= "MIME-Version: 1.0\r\n";
$header .= "Content-type: text/html\r\n";

$retval = mail ($to,$subject,$body,$header);

if( $retval == true ) {
header("location:verify.php");
}else {
echo "Message could not be sent...";
}

//echo "

Details Saved!

";
}
}
else
{
echo 'Error' . mysqli_error($conn);
}
}
Posted
Updated 19-Dec-17 1:15am
v2

1 solution

Spam detection runs on the client (mail receiver) side. So you can't do much in your PHP script.

What you can do is providing proper and valid headers and changing the subject and the body text. A message body containing only "Dear $name" is very probably tagged as spam by most filters because that form of address is often used by spam mails (increases spam probability count) and there is no more text that reduces such counts.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900