mail are delivered in the spam folder instead of inbox
hi friends i am using php mail function to deliver my mail to my group member, i am using smtp server but my mails are delivered in the spam folder instead of the inbox i did not create any spam filter in my mail id please guide how to solve this issue
$email = GetUserEmailID(GetUserIdfromNews($newsvl[$k]));
$username = GetUserAdminName(GetUserIdfromNews($newsvl[$k]));
$headers = "MIME-Version: 1.0\r";
$headers .= "Content-type: text/html; charset=iso-8859-1\r";
$headers .= "From: <$fromemail>";
$subject = "Posted News has been Approved by Administrator";
$msg ="Hello <font color='#0000FF'>".ucfirst($username)."</font>\n\n<br><br>";
$msg.="***********开发者_JAVA百科*************************************\n<br>";
$msg.="Congrats, Your Last Posted News has been Approved by Administrator\n<br>";
$msg.="************************************************\n<br>";
// echo $msg." ".$subject." ".$email.
// " ".GetUserIdfromNews($newsvl[$k])." ".$newsvl[$k];
mail($email, $subject, $msg, $headers);
My from id is xx@yahoo.com it is valid id
this is indeed the first problem: The sender address you use should be running on the domain you send the E-Mail from.
For other common reasons for this, see the duplicate link.
Have you tried to figure out how was your mail being sent? mail()
is simply a built-in function that deliver mail to the local SMA (e.g. sendmail
), from that point on it's depend on your machine's configuration.
Most likely, as Pekka suggests, is that the recipient had determined that the SMTP server you are sending from is untrustworthy to send a mail claim to be from.
If you have no control over your php environment, consider using function from libraries that utilize servers from free but well-known e-mail providers, e.g. GMail's SMTP-TLS server. You have to write my-php-app@gmail.com
(whatever account you are using) in the Form field, however you may assign an Reply-To
to reveal the actual e-mail that is monitored.
精彩评论