Do you have a question? Post it now! No Registration Necessary. Now with pictures!
- Posted on
- PEAR mailing problem
January 30, 2007, 12:31 pm
rate this thread
When I run this code from command line using the command "php
automaticMail.php" the code works fine.
But when i run this script from browser it give the error :
Starting..... Error sending mail: (unable to connect to smtp server
10.110.8.212:25) End of Program
I am not figure out how this could happen ??? Sam code runs from
command line sending mails correctly but not through the apache
$headers["From"] = "$from";
$headers["Reply-To"] = "$replyto";
$headers["To"] = $recipients;
$headers["Subject"] = "$sub";
$msg = "test";
$params["host"] = $smtp_server;
$params["port"] = $smtp_port;
if (PEAR::isError($mail_object = Mail::factory('SMTP', $params)))
echo "Failed to create PEAR::Mail object\n";
if (PEAR::isError($send = $mail_object->send($recipients, $headers,
echo "Error sending mail: (". $send->getMessage() .")";
echo "Mail sent ". count($recipients) ." recipients.";
echo 'End of Program';
Re: PEAR mailing problem
This is a hell of an active usenetgroup.
I think nobody knows what is wrong.
I never use PEAR MAIL, but I would first try to send via php's own mail
function to see if you can send mail with that.
- » Sending a GET request and getting the response using fsockopen.
- — Previous thread in » PHP Scripting Forum