PEAR Forum :: PHP Extension and Application Repository

PEAR Forum Forum Index
 FAQFAQ   SearchSearch   MemberlistMemberlist   RegisterRegister   ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 
Pear sends emails into abyss...sometimes?

 
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail
View previous topic :: View next topic  
Author Message
krisp23



Joined: 08 Jun 2008
Posts: 1

PostPosted: Sun Jun 08, 2008 8:12 am    Post subject: Pear sends emails into abyss...sometimes? Reply with quote

I've seen other posts elude to this issue but they always seem to trail off in a different directions. Bottom line, PEAR mail seems to send my emails fine 90% of the time. BUT, 1 out of 10 times, the email should be sent, but never shows up at some of the recipients. And to be clear, these are the same recipients that received the email successfully the previous 9 times. No bounceback, no spam folder...just nothing. I've noticed this several times with my Hotmail address and once with a Yahoo as the recipient. For one particular email that didn't make it to a Hotmail account, I know that it didn't make it to multiple Hotmail accounts. My hosting company's support sucks so it looks like I'm on my own. I need some peace of mind that my email notifications are actually going out and being received 100% of the time unless there is a bounceback. I'm fairly new to PEAR mail after switching from PHP mail() so any assistance would be appreciated! Thank you!!!

Here is my function.

Code:
function sendTopictoGroup(){
   require_once "Mail.php";

   $fname = $_SESSION['f_name'];
   $lname = $_SESSION['l_name'];
   $topic_id = $_SESSION['topic_id'];
   $topic = stripslashes($_POST[topic_title]);

   $to = $_SESSION['forum_emails'];
   $from = "me <no-reply@mydomain.com>";
   $subject = "blah";
   $body = "blahblah";

   $host = "mail.mydomain.com";
   $username = "user@mydomain.com";
   $password = "password";

   //DO NOT INCLUDE TO ADDRESSES IN HEADER SO RECIPIENTS CANT SEE EMAILS
   $headers = array ('From' => $from,
     'Subject' => $subject);
   $smtp = Mail::factory('smtp',
     array ('host' => $host,
      'auth' => true,
      'username' => $username,
      'password' => $password));

   $mail = $smtp->send($to, $headers, $body);

   if (PEAR::isError($mail)) {
        echo("<p>" . $mail->getMessage() . "</p>");
   } else {
      *do something*
   }
}
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    PEAR Forum Forum Index -> Mail All times are GMT + 2 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum



PEAR Forum topic RSS feed 
Powered by phpBB © 2001, 2005 phpBB Group

Provided by Ministry of Web developement

'Actiemonitor' online projectmanagement software