PDA

View Full Version : PHP: ini_set();



Drunken
June 11th, 2003, 10:28 AM
Hy!

I have a little problem, that is about php.ini. The SMTP is localhost and want change it during the script. I think it's possible by using the function ini_set();... i am doing this but doesn't work:


ini_set ("STMP","stmp.apie.pt");

The PHP version in server is 4.0.6, and i don't have the possiblity to change that option in php.ini, that 's why i want to change it during the script.

thks

Jubba
June 11th, 2003, 10:34 AM
according to the manual you can't set that during a script.

http://us3.php.net/manual/en/function.ini-set.php

that should give you all the info you need. :)

Drunken
June 11th, 2003, 10:38 AM
thks, but u know how to change this option?

Jubba
June 11th, 2003, 10:42 AM
hmmm, it does say that it can be set anywhere.... why do you need to set it? Maybe we can find a workaround...

Drunken
June 11th, 2003, 10:45 AM
I need to change it because want to send a e-mail and doesn't work because the option is 'localhost', as u can se it www.apie.pt/klog/info.php :|

Jubba
June 11th, 2003, 10:51 AM
I don't think that is your problem. My server is set to localhost as well and I send e-mails like crazy...


http://www.bluefinatlantic.com/chmod.php

Jubba
June 11th, 2003, 11:01 AM
It might be that your server has the mail() function disabled. Many servers do that to deter spammers from sending out mass mails. You might just want to check with them...

or is it working, just not 100% accurately?

Drunken
June 11th, 2003, 12:10 PM
hmmm...maybe that's problem. I will talk with system adminstrator to resolve this problem...

thks for the help

Drunken
June 11th, 2003, 12:22 PM
Look, the function mail is like that:

$message="hello world!";
mail("nunoleao@mail.com", "the subject", $message,
"From: webmaster@{$_SERVER['SERVER_NAME']}\r\n"
."Reply-To: webmaster@{$_SERVER['SERVER_NAME']}\r\n"
."X-Mailer: PHP/" . phpversion());

isn't it ?

Drunken
June 11th, 2003, 12:45 PM
jesuz it was a mistake!!

it work good! 2h lost in this grrrrr

jebba thks for everthing, u really are a nice person!

Drunken
June 11th, 2003, 12:46 PM
sorry, *jubba :)

Jubba
June 11th, 2003, 01:11 PM
I'm glad you figured it out. ! :)