chenci Posted July 27, 2009 Share Posted July 27, 2009 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 More sharing options...
patrickmvi Posted July 27, 2009 Share Posted July 27, 2009 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/ Link to comment https://forums.phpfreaks.com/topic/167585-mail-problems-to-hotmail-and-yahoo/#findComment-883860 Share on other sites More sharing options...
chenci Posted July 29, 2009 Author Share Posted July 29, 2009 I've tried that script, there are some problems conecting to gmail SMTP, I've use the test script for gmail but it didn't work, do you have a test script for gmail different from the one of PHPMailer? Link to comment https://forums.phpfreaks.com/topic/167585-mail-problems-to-hotmail-and-yahoo/#findComment-885589 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.