Board index   FAQ   Search  
Register  Login
Board index php forum :: php coding PHP coding => Mail

$_SERVER['DOCUMENT_ROOT doesn't work

the mail() function

Moderators: macek, egami, gesf

$_SERVER['DOCUMENT_ROOT doesn't work

Postby yang » Wed Nov 21, 2012 6:55 am

Hi,
im using phpmailer to send email, what is confusing me is that: (this actually is not a problem about phpmailer, but is what did i face when i tried to call phpmailer class in my php file)


firstly, i tried to include the phpmailer class file by:
require_once($_SERVER['DOCUMENT_ROOT'].'/config.php');
require_once($_SERVER['DOCUMENT_ROOT'].'/lib/MailClass.inc');
it didn't work. it said "files can't find".

then i tried: require("config.php");
require "lib/MailClass.inc"; it works

could someone explain this for me?

really confusing now

regards
yang
New php-forum User
New php-forum User
 
Posts: 2
Joined: Tue Nov 06, 2012 5:56 am

Re: $_SERVER['DOCUMENT_ROOT doesn't work

Postby seandisanti » Fri Nov 23, 2012 2:44 pm

try echoing those values instead of requiring them
seandisanti
php-forum Fan User
php-forum Fan User
 
Posts: 773
Joined: Mon Oct 01, 2012 12:32 pm


Return to PHP coding => Mail

Who is online

Users browsing this forum: No registered users and 1 guest

Sponsored by Sitebuilder Web hosting and Traduzioni Italiano Rumeno and antispam for cPanel.