fluidsharp Posted June 15, 2011 Share Posted June 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/239419-how-to-replace-smtpmailpear/ Share on other sites More sharing options...
taquitosensei Posted June 15, 2011 Share Posted June 15, 2011 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")); Quote Link to comment https://forums.phpfreaks.com/topic/239419-how-to-replace-smtpmailpear/#findComment-1229973 Share on other sites More sharing options...
fluidsharp Posted June 15, 2011 Author Share Posted June 15, 2011 I ask support, here is answer: Thank you for contacting us. Unfortunately the PEAR package is not installed and cannot be installed on the shared hosting environment. Quote Link to comment https://forums.phpfreaks.com/topic/239419-how-to-replace-smtpmailpear/#findComment-1230172 Share on other sites More sharing options...
taquitosensei Posted June 15, 2011 Share Posted June 15, 2011 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. Quote Link to comment https://forums.phpfreaks.com/topic/239419-how-to-replace-smtpmailpear/#findComment-1230198 Share on other sites More sharing options...
fluidsharp Posted June 16, 2011 Author Share Posted June 16, 2011 Thanks! Quote Link to comment https://forums.phpfreaks.com/topic/239419-how-to-replace-smtpmailpear/#findComment-1230485 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.