Jump to content

How to replace SMTP.Mail.PEAR


fluidsharp

Recommended Posts

Hi all!

 

I have installed PEAR, mail and sendmail on localhost and everything works fine and I was so happy. But when I moved code to server I found out that I cannot use PEAR there.

 

Could you give me advice ?

What php function I should use to write own script to send mail via SMTP?

 

Thank you in advice.

Link to comment
https://forums.phpfreaks.com/topic/239419-how-to-replace-smtpmailpear/
Share on other sites

why can't you use pear? You should be able to just put your pear directory tree in an includes folder and include the files you need. For example if on your local system pear is in /usr/share/pear  or something like that, and your web root is /var/www/vhosts/yourwebsite.com    put the pear folder in /var/www/vhosts/yourwebsite.com/includes/    then set the include path

ini_set("include_path",$_SERVER['DOCUMENT_ROOT']."/includes/".PATH_SEPARATOR.$_SERVER['DOCUMENT_ROOT']."/includes/pear/".APATH_SEPARATOR.ini_get("include_path"));

 

pear is a set of php files. If your web server can parse php files then you can use pear. It's just not in the default location for the operating system. Just upload the "pear" folder from your local machine to the web server. Then set the include path. Then call the files as normal.

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.