Jump to content

Mail () Problems to hotmail and yahoo


chenci

Recommended Posts

This is what i got so far.

<? function mailer ()
{
    global $website_email;
    if ((isset($_SESSION['Username'])) && (($_SESSION['Mode'] == 'admin') || ($_SESSION['Id'] == $r['postedby'])))
    {
        $adminemail = $website_email;
        $from = "From: \"Administrador de Craken\" <$adminemail>";
        $id = $_REQUEST['id'];
            msqlcon();
            $query = mysql_query("SELECT * FROM " .s('prefix'). "articles WHERE id='$id'");
            $r = mysql_fetch_array($query);
        $subject = $r['title'];
        $upperbody = "This is a original copy of the post";
        $mainbody = $r['text'];
        $signature = "Admin";
        // echo $subject;
        // echo $mainbody;
            $query = "SELECT * FROM " .s('prefix'). "users WHERE recievemail = 'YES' ORDER BY id DESC";
            $result  = mysql_query($query) or die("SQL Error");
            $emails = array();
            while($e = mysql_fetch_array($result))
            {
                $emails[] = $e['email'];
            }
        $to_mail = implode(",", $emails);
        // echo implode(",", $emails);
        If(mail($to_mail,$subject,$upperbody.$mainbody.$signature,$from)) 
        {
            exit("Mail sent <b>ok</b>.");
        } 
        else
        {
            exit("Sending mail <b>failed</b>.");
        }
    }?>

Now i can recieve mail from gmail accounts, but i tested sending to my hotmail and yahoo mails without any success, i also checked if there are in the junk or spam section, but there are not. It seems the mail didn't arrive to the destination. Oh mysqlcon is a function i define with all mysql data so don't worry with that. Does anyone know why?

Link to comment
https://forums.phpfreaks.com/topic/167585-mail-problems-to-hotmail-and-yahoo/
Share on other sites

Some services out there will only accept properly formatted messages.  Unfortunately, the mail function does not actually handle any kind of actual SMTP headers or text folding.  You should use a class like PHPMailer to do your mailing.  It will use all of the proper SMTP standards to create your message and therefore give it a much better chance of making it through spam filters.  You can get PHPMailer here:

 

http://sourceforge.net/projects/phpmailer/

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.