Siddiq Ansari - 2013-12-08 22:19:07
I used the class to send bulk email but I got this message and no any emails are send to recipients. What should I do can you help me please?
Manuel Lemos - 2013-12-08 23:55:40 - In reply to message 1 from Siddiq Ansari
Very likely there was an error. Did you check the $error variable with the value returned by the Send() function?
Siddiq Ansari - 2013-12-10 04:16:30 - In reply to message 2 from Manuel Lemos
The only error I got was "It was not possible to open sendmail input pipe"
and the code I used is like this,as you have provided in the example:
$message->SetEncodedHeader('Subject', 'Some subject');
* Define the recipients list
* Create a place holder text message body part
$text = 'Hello, some text message';
* Create a place holder HTML message body part
$html = 'Hello, some HTML message';
$message->CreateQuotedPrintableHtmlPart($html, '', $html_part);
* Assemble the text and HTML parts as alternatives
$alternative_parts = array($text_part, $html_part);
* Cache the message for all recipients
$message->cache_body = true;
* Iterate for each recipient.
foreach($to as $recipient)
/* Personalize the recipient address. */
/* Send the message checking for eventually acumulated errors */
Manuel Lemos - 2013-12-10 04:43:02 - In reply to message 3 from Siddiq Ansari
Your sendmail or compatible program may be broken.
Can you go in the shell of you server and try to list these sendmail files using ls here?
ls -l /usr/lib/sendmail
ls -l /usr/sbin/sendmail
Siddiq Ansari - 2013-12-10 07:11:47 - In reply to message 4 from Manuel Lemos
I do not have shell access from my cpanel. But I can send mail using "mail()" function without any error. What should I do?
Manuel Lemos - 2013-12-10 07:18:09 - In reply to message 5 from Siddiq Ansari
Shell access is via ssh.
Anyway, you can always execute a PHP script like this to evaluate if sendmail or compatible is installed:
Siddiq Ansari - 2013-12-11 09:59:43 - In reply to message 6 from Manuel Lemos
I got this things: b:1;b:1;
Jurgen Goedbloed - 2014-09-26 21:31:50 - In reply to message 7 from Siddiq Ansari
I also got this error. It turned out to be that the popen function, used by the sendmail class, was not allowed in php.
This was because it was listed in the disable_functions configuration parameter in php.ini
You can check by executing this little php script:
popen ("/usr/lib/sendmail -t -i","w")
If you get the error
PHP Warning: popen() has been disabled for security reasons ...
then popen is disabled.
Manuel Lemos - 2014-09-26 22:37:42 - In reply to message 8 from Jurgen Goedbloed
It seems your PHP configuration is not allowing you to call external programs. You can always use the base class email_message_class. It is not as efficient, but it should work.