Jump to content

Recommended Posts

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.
Link to comment
https://forums.phpfreaks.com/topic/294370-installing-phpmailer/
Share on other sites

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 by QuickOldCar
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.