Mail () Problems to hotmail and yahoo

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
chenci
Forum Newbie
Posts: 5
Joined: Sun Jul 26, 2009 4:50 pm

Mail () Problems to hotmail and yahoo

Post by chenci »

This is what i got so far.

Code: Select all

<? 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. Does anyone know why?
Eric!
DevNet Resident
Posts: 1146
Joined: Sun Jun 14, 2009 3:13 pm

Re: Mail () Problems to hotmail and yahoo

Post by Eric! »

Take a look at these recent discussions.
viewtopic.php?f=1&t=103674

and
viewtopic.php?f=1&t=103662
User avatar
jackpf
DevNet Resident
Posts: 2119
Joined: Sun Feb 15, 2009 7:22 pm
Location: Ipswich, UK

Re: Mail () Problems to hotmail and yahoo

Post by jackpf »

Yay my thread :D

Yeah, you'll probably want to go through all them sites and check blacklists and stuff. Even if you're not a spammer, you may be on a blacklist due to your server having poorly configured smtp settings, or a previous owner of your domain may have been a spammer.
Post Reply