how to use php pear mail

删除回忆录丶 提交于 2019-12-02 18:18:48

Check if pear is installed in the system . If yes then specify path to Pear installation directory in php.ini include_path directive

You need to install PEAR and PEAR MAIL packages to get it working

Your error message is self-explanatory. Make sure you have PEAR::Mail installed on your machine, if not then please install it.

Linux:

pear install Mail

Windows:

http://www.geeksengine.com/article/install-pear-on-windows.html

If the process is done.

Then please include your Mail.php in your script (probably before you instantiate Mail object. This should probably kick your warnings away.

include "/path/to/pear/Mail.php";

or

set_include_path("/path/to/pear"); include "Mail.php";

Also make sure there is enough permission given for Mail.php for PHP to read.

I pieced together these steps from the web and it works:

How to install PEAR: 1. Download go-pear.phar at http://pear.php.net/go-pear.phar & save to php directory (eg C:\Program Files\PHP\) 2. Open a command window as administrator, move to your php directory, CMD: php go-pear.phar 3. Accept the default value for everything it asks about; system wide, path options, updating your php.ini etc 4. In php directory double-click PEAR_ENV.reg to update your registry Then you need to install PEAR MAIL: 5. CMD: php go-pear.phar 6. CMD: pear install --alldeps mail 7. CMD: pear channel-update pear.php.net Make sure to have this in your email script: require_once "Mail.php";

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!