Kurt111780
Technical User
Hello,
I have a php email script. No matter what i seem to do it keeps going to the users junk folder when sent to outlook, msn, or yahoo. How can I keep it from going to the junk mail folder? I am using bcc but i removed that with no luck. What can I do?
It's only easy when you know how.
I have a php email script. No matter what i seem to do it keeps going to the users junk folder when sent to outlook, msn, or yahoo. How can I keep it from going to the junk mail folder? I am using bcc but i removed that with no luck. What can I do?
Code:
<?php
// ************ Begin Email script *****************
//set Variables
//$toEmail = "me@msn.com";
// $toName = "To Kurt";
$to = $toName . " <" . $toEmail . ">";
$fromEmail = "me@mydomain.com";
$fromName = "from Kurt";
$from = $fromName . " <" . $fromEmail . ">";
$subject ='email form';
$body = "
<html>
<body>
<table border=\"1\" cellpadding=\"0\" cellspacing=\"0\" width=\"500\" height=\"500\" bordercolor=\"#669999\">
<tr><td height=\"125\" valign=\"middle\">
<img src=\"[URL unfurl="true"]http://www.mydomain.com/php/mail/smLogo.gif\"[/URL] border=\"0\" alt=\"my Logo\">
</td></tr>
<tr>
<td valign=\"top\">
<b>The files requested are ready for download.</b>
<br>
<a href=\"[URL unfurl="true"]http://www.mydomain.com/php/download.php?pageID=$pageID\">Download[/URL] Files</a>
<font color=\"red\">here</font>
</td></tr>
</table>
</body>
</html>
";
/* Specify your SMTP Server, Port and Valid From Address */
ini_set("SMTP","mail.mydomain.com");
ini_set("smtp_port","25");
ini_set("sendmail_from",$fromEmail);
// Additional Headers
$headers = "Bcc:" . $from . "\r\n";
//specify MIME version 1.0
$headers .= "Content-Type: text/html; charset=iso-8859-1\n";
// Try to send message and respond if it sends or fails.
if(mail ($to, $subject, $body, $headers ))
{
echo "<h2>Your Message was sent!</h2>";
}
else
{
echo "<font color='red'><h2>Your Message Was Not Sent!</h2></font>";
}
exit;
//***************** End Email Script **********************
?>
It's only easy when you know how.