Jump to content

PEAR mail


kaz3

Recommended Posts

I am using this modified script I found to send emails from my site.

 

function SendMail($to, $subject, $body, $from, $headers) {
    $headers['From']     = $from;
    $headers['To']        = $to;
    $headers['Subject']    = $subject;

    $params['host']     = ini_get('SMTP');

    $smtp =& Mail::factory('smtp', $params);
    $mail = $smtp->send($to, $headers, $body);
}

 

I have tried many different versions of sending mail with many different scripts but they all end up having the same problem. I always get this error:

Fatal error: Call to undefined method PEAR_Error::send() in packages.php on line 69

and line 69 is this:

$mail = $smtp->send($to, $headers, $body);

 

Does this mean I don't have PEAR installed? How do I fix it?

Link to comment
https://forums.phpfreaks.com/topic/161974-pear-mail/
Share on other sites

Without shell access its rather difficult to troubleshoot.

 

You can ask your host what the error logs state, and if there is anything in the mail log or not.

 

If the Pear SMTP class doesn't work you can try the PHP Mailer Class

 

http://www.hostmysite.com/support/linux/programming/phpmailer/

Link to comment
https://forums.phpfreaks.com/topic/161974-pear-mail/#findComment-854835
Share on other sites

Cant you just use phps

mail()

function?

 

I have used it before and it had worked fine until the emails I sent did not show in proper format sometimes. When I sent HTML emails to a web mail account(yahoo, msn, etc), they were shown just as I wanted. But when the mail read in an application such as Outlook, it was just plain text. I figured it was the way the mail function worked.

Link to comment
https://forums.phpfreaks.com/topic/161974-pear-mail/#findComment-855591
Share on other sites

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.