Jump to content

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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.