Page 1 of 1

PhpMailer problem

Posted: Sat Oct 15, 2005 9:58 am
by mhouldridge
Hi,

I have extracted phpmailer to e:/grd/lib/phpmailer and have also used the FreakMailer class to input the main functions to save time.

My mailtest.php script works however I get the following errors relating to undefined index;


Notice: Undefined index: DOCUMENT_ROOT in E:\GRD\mailtest.php on line 2

Notice: Undefined index: DOCUMENT_ROOT in E:\GRD\mailtest.php on line 4

Notice: Undefined index: DOCUMENT_ROOT in E:\GRD\mailtest.php on line 7

Notice: Undefined index: DOCUMENT_ROOT in e:\grd\lib\MailClass.inc on line 2
Mail sent!


AS far as I can see, the paths to the files are correct, and look as follows;

require_once($_SERVER['DOCUMENT_ROOT'].'e:/grd/config.php')

Does naybody know why this is happening?

thanks

Posted: Sat Oct 15, 2005 10:11 am
by Roja
Your apache isn't setting the document_root. Some versions don't.

Posted: Sat Oct 15, 2005 10:12 am
by mhouldridge
Hi,

I am using IIS.

Posted: Sat Oct 15, 2005 12:04 pm
by Roja
mhouldridge wrote:Hi,

I am using IIS.
Okay, so IIS isn't setting the document_root. Use a different variable instead.

Posted: Sat Oct 15, 2005 1:30 pm
by hanji

Code: Select all

require_once($_SERVER['DOCUMENT_ROOT'].'e:/grd/config.php')

I would just remove the whole $_SERVER["DOCUMENT_ROOT"] piece out.. since you're specifying the whole path including drive after it. That's why the script still works.. and you're just getting NOTICE alerts.

hanji