|
Siddiq Ansari - 2013-12-08 22:19:07
Hello,
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?
thanks
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:
<?php
require('bulkmail/email_message.php');
require('bulkmail/sendmail_message.php');
$message=new sendmail_message_class;
$message->SetBulkMail(true);
$message->SetEncodedHeader('Subject', 'Some subject');
/*
* Define the recipients list
*/
$to=array(
array(
"address"=>"abc@siddiq.com.np",
"name"=>"abc xys"
),
array(
"address"=>"abc@gmail.com",
"name"=>"the cellroti"
),
array(
"address"=>"whyisthis@yahoo.com",
"name"=>"saka"
)
);
/*
* Create a place holder text message body part
*/
$text = 'Hello, some text message';
$message->CreateQuotedPrintableTextPart($text, '',$text_part);
/*
* 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);
$message->AddAlternativeMultipart($alternative_parts);
/*
* Cache the message for all recipients
*/
$message->cache_body = true;
/*
* Iterate for each recipient.
*/
foreach($to as $recipient)
{
/* Personalize the recipient address. */
$message->SetEncodedEmailHeader('To',
$recipient['address'], $recipient['name']);
/* Send the message checking for eventually acumulated errors */
$error=$message->Send();
if(strlen($error))
break;
}
?>
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
or
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:
echo serialize(file_exists('/usr/lib/sendmail'));
echo serialize(file_exists('/usr/sbin/sendmail'));
Siddiq Ansari - 2013-12-11 09:59:43 - In reply to message 6 from Manuel Lemos
Hello sir,
I got this things: b:1;b:1;
Jurgen Goedbloed - 2014-09-26 21:31:50 - In reply to message 7 from Siddiq Ansari
Hi,
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:
<?php
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.
|