Hagioscope Posted February 4, 2015 Share Posted February 4, 2015 Having trouble with installation of PHPMailer and hoping to get some insights. I loaded the package and ran PHPMailerAutoLoad.php. I get no errors or confirmations, just a blank page. Other php documents run from the same directory, so I can only assume it's running. On the server though, I can find no sign of anything having been installed. So I'm resorting to manual installation which apparently involves nothing more than placing the key files in the desired directory. I'd like to make that the default include-path but can't determine what that is. phpinfo() shows include-path as ".:". Does that mean it's set for a root level or is it empty? If it's a root level, how can I determine what it's relative to? Would I possibly disrupt something else if I set a new include-path? (since I don't know if anything is already loading from it) Finally, perhaps the dumb part of my question, can I load PHPMailer there as a folder or do I need to drop the parts into the root level of the include-path directory? FWIW, I've been successfully sending mail w and w/o attachments from the server with PHP for some time. Now I need to authenticate and send via an SMTP server. Rather than switch to a Python process I've used, I'm hoping to get PHPMailer in place and working so I can stay with PHP across multipe sites. I've chosen it over PEAR as my better hope. Quote Link to comment https://forums.phpfreaks.com/topic/294370-installing-phpmailer/ Share on other sites More sharing options...
QuickOldCar Posted February 4, 2015 Share Posted February 4, 2015 (edited) Can read their tutorial at http://phpmailer.worxware.com/?pg=tutorial A lot of the paths are set to run the examples from within it's same directory It's a matter of making a new script wherever need to use it, even using one of the examples they have. Set the paths to what you need depending where you are placing them, also fill in any missing values need to set I get no errors or confirmations, just a blank page. That doesn't do or output anything, just tries to load the class files can I load PHPMailer there as a folder or do I need to drop the parts into the root level of the include-path directory? Place the PHPmailer files into your root /www/ or the new /www/html/ directory Looking at PHPMailer-master/test/phpmailerTest.php it has... require_once '../PHPMailerAutoload.php'; this will always assume you are going to be running the script 2 directories deep from current directory try... require_once($_SERVER['DOCUMENT_ROOT'] . "/PHPMailer-master/PHPMailerAutoload.php"); you will also notice in that script these public $Host = ''; this needs to be your smtp mail host such as public $Host = "smtp.mydomain.com"; public $INCLUDE_DIR = '../'; could be set to public $INCLUDE_DIR = $_SERVER['DOCUMENT_ROOT'] . "/"; for this section you can just change it's path to what need if (file_exists('./testbootstrap.php')) { include './testbootstrap.php'; //Overrides go in here } to if (file_exists($_SERVER['DOCUMENT_ROOT'] . "/PHPMailer-master/test/testbootstrap.php")) { include($_SERVER['DOCUMENT_ROOT'] . "/PHPMailer-master/test/testbootstrap.php"); //Overrides go in here } Edited February 4, 2015 by QuickOldCar Quote Link to comment https://forums.phpfreaks.com/topic/294370-installing-phpmailer/#findComment-1504857 Share on other sites More sharing options...
Hagioscope Posted February 4, 2015 Author Share Posted February 4, 2015 Thanks, that gives me a lot to run with. Quote Link to comment https://forums.phpfreaks.com/topic/294370-installing-phpmailer/#findComment-1504866 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.