PHP Classes

missing recipients

Recommend this page to a friend!

      MIME E-mail message sending  >  MIME E-mail message sending package blog  >  How Can PHP Send Emai...  >  All threads  >  missing recipients  >  (Un) Subscribe thread alerts  
Subject:missing recipients
Summary:the to header field doesn't appear to populate correctly
Messages:3
Author:Devin Smith
Date:2010-09-16 03:17:32
Update:2010-09-16 12:45:15
 

  1. missing recipients   Reply   Report abuse  
Picture of Devin Smith Devin Smith - 2010-09-16 03:17:32
I'm using php on a Mac OS X server 10.4. I have been unable to send e-mails using the mime message package. I get no errors thrown on send but when I check /var/log/mail.log, the log shows that the message bounces because there are no recipient. Our span filter shows a matching bounce but the system does not know who to notify that the message bounced since there is no reply-to or sender even though these have been set as well.

I thought at first it was my code. So I put up one of the test message scripts that comes in the package and it has the same problem. So not my code.

This machine has been sending messages using an old phpmail library file so I know the machine can send - but there was some difficulty with that. Setting the to would not work. I had to set recipients in order to get the messages to go. So I have tried that with the mime message package as well - $email_message->SetEncodedEmailHeader("Recipients", $to_address,$to_name); as well as setting the "To" and it still ends up bounced because of no recipients....

A friend sent me some test code that when the page loads, it is supposed to send a html formatted email as well as display the contents of the message in the browser and includes a link to send the message again. On first load, it does not send the message and when I check the log, it is bounced with no recipients. If I click the link to resend, it does successfully sends the message.

Any ideas where to even begin to look? I've gone through the forums and seen nothing similar.

Regards
Devin

  2. Re: missing recipients   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2010-09-16 04:56:37 - In reply to message 1 from Devin Smith
The email_message_class just calls the PHP mail() function. By default the mail() function uses the sendmail program to send messages but that should be configured correctly in your php.ini file.

On Linux the sendmail_path variable is usually set to "/usr/sbin/sendmail -t -i" . On the Mac it should be something equivalent. The -t parameter is important to make sendmail read the recipients from the headers. Maybe that is what your php.ini file is missing.

  3. Re: missing recipients   Reply   Report abuse  
Picture of Devin Smith Devin Smith - 2010-09-16 12:45:16 - In reply to message 2 from Manuel Lemos
Fixed! Your advice was correct. I added the -t -i to the sendmail command and restarted php. Test messages was delivered.

Thank you! Thank you! Thank you!