 |
|
|
| View previous topic :: View next topic |
| Author |
Message |
krisp23
Joined: 08 Jun 2008 Posts: 1
|
Posted: Sun Jun 08, 2008 8:12 am Post subject: Pear sends emails into abyss...sometimes? |
|
|
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 |
|
 |
|
|
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
|
|