This topic is locked

Mail getting dumped into spam folders

8/10/2009 9:52:14 PM
PHPRunner General questions
J
jalongi author

Yahoo, AOL and MSN are dropping the password remind emails into the spam folders. Other email servers (i.e. Brighthouse) pass the emails through to the users inbox with no problem. I want to try and add additional headers (i.e.return path) but the mail() command seems to have been replaced by runner_mail. How do I add the parameters to runner_mail in the remind.php file? I cannot find the mail() command anywhere.
Thanks

Joe

J
Jane 8/11/2009

Hi,
you can pass 'from' parameter in the runner_mail function in the remind.php file.

More info here:

http://www.xlinesoft.com/phprunner/docs/ru...il_function.htm

J
jalongi author 8/15/2009

This is driving me crazy. Below is simple php code to send an email to yahoo. It works and the mail ends up in the inbox.
<?php

$to = "name@yahoo.com";

$subject = "testmail";

$message="Password reminder";

$from = "name@domain.com";

$headers = "From: $from";

date_default_timezone_set("America/New_York");

mail($to,$subject,$message);

echo "Mail Sent.";

?>
This is the code from the remind.php form. The email here ends up in the yahoo spam folder.
$password=$data[1];

$url = GetSiteUrl();

$url.=$_SERVER["SCRIPT_NAME"];

$message="Password reminder"."\r\n";

$message.="You asked to remind your username and password at"." ".$url."\r\n";

$message.="Username".": ".$data[0]."\r\n";

$message.="Password".": ".$password."\r\n";

$subject = "Password Reminder";

date_default_timezone_set("America/New_York");

mail ($data[2],$subject,$message);

//runner_mail(array('to' => $data[2], 'subject' => "Password reminder", 'body' => $message));

.....
Why is this happening? They are both going out the same way.
Thank you.
Joe Alongi

M
maali 8/16/2009

This is driving me crazy. Below is simple php code to send an email to yahoo. It works and the mail ends up in the inbox.

<?php

$to = "name@yahoo.com";

$subject = "testmail";

$message="Password reminder";

$from = "name@domain.com";

$headers = "From: $from";

date_default_timezone_set("America/New_York");

mail($to,$subject,$message);

echo "Mail Sent.";

?>
This is the code from the remind.php form. The email here ends up in the yahoo spam folder.
$password=$data[1];

$url = GetSiteUrl();

$url.=$_SERVER["SCRIPT_NAME"];

$message="Password reminder"."\r\n";

$message.="You asked to remind your username and password at"." ".$url."\r\n";

$message.="Username".": ".$data[0]."\r\n";

$message.="Password".": ".$password."\r\n";

$subject = "Password Reminder";

date_default_timezone_set("America/New_York");

mail ($data[2],$subject,$message);

//runner_mail(array('to' => $data[2], 'subject' => "Password reminder", 'body' => $message));

.....
Why is this happening? They are both going out the same way.
Thank you.
Joe Alongi


Hi Joe

You havde to identify your sender mail in the headers because Yahoo and gmail and hotmail, they alle check the senders mail and if it is not identified than it

will be put in the junk mail:
do like this:
$headers = "From: blabla.com <blabla@gmail.com>";
the blabla@gmail.com should be a valide email adress.
cheers
maali

J
jalongi author 8/22/2009

Hi Maali

Thanks for the suggestion, but it still goes to the junk mail folder. This is what I have:
$password=$data[1];

$url = GetSiteUrl();

$url.=$_SERVER["SCRIPT_NAME"];

$message="Password reminder"."\r\n";

$message.="You asked to remind your username and password at"." ".$url."\r\n";

$message.="Username".": ".$data[0]."\r\n";

$message.="Password".": ".$password."\r\n";

$subject="Password Reminder";

$headers="From: name@mydomain.com <name@mydomain.com>\r\n";

$headers .= "X-Mailer: PHP's mail() Function\r\n";

$headers .= "MIME-Version: 1.0\r\n";

$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";

$headers .= "Content-transfer-encoding: base64\r\n";

mail ($data[2],$subject,$message,$headers);

// runner_mail(array('to' => $data[2], 'subject' => "Password reminder", 'body' => $message));

$reminded=true;

if(function_exists("AfterRemindPassword"))

AfterRemindPassword($strUsername,$strEmail);

$loginlink_attrs="href=\"login.php";

if($strSearchBy!="email")

$loginlink_attrs.="?username=".rawurlencode($strUsername);

$loginlink_attrs.="\"";

$xt->assign("loginlink_attrs",$loginlink_attrs);

$xt->assign("body",true);

$_SESSION["count_captcha"]=$_SESSION["count_captcha"]+1;

$xt->display("remind_success.htm");

return;

}
This only happens in the remind.php file. Exact same code in a stand alone php file works. Any other ideas?
Thanks,
Joe

J
jalongi author 8/22/2009

FINALLY found the problem. Took the $url out of the message line and it went through.
Joe