Page 1 of 1

php mail ...how?

Posted: Sat Sep 11, 2004 7:20 pm
by crazytopu
Hi,

I tested the php mail function with my local server where i could change the php.ini file and it all worked well. But what if I want to use the function when my script will reside on a server where I have no access to the php.ini file?

What information do I have to add inside the script in this case and where?

Posted: Sat Sep 11, 2004 7:33 pm
by nigma
You might be able to use ini_set().

Posted: Sat Sep 11, 2004 7:48 pm
by dull1554
allthough any web server with php support probably has builtin support for the mail function, because allmost and i said allmost all servers have a mail server

Posted: Sat Sep 11, 2004 8:27 pm
by crazytopu
So, dull554, you mean I dont have to add any extra thing? It would be suffice if I just upload the script that uses mail function without being concerned about the server's php.ini configuration?

Posted: Sat Sep 11, 2004 8:44 pm
by feyd
just make sure the script can handle the mail function failing, maybe with some "debugging" help for the person installing it.

Posted: Sat Sep 11, 2004 8:58 pm
by dull1554
maybe do smoething llike this

Code: Select all

$mail = mail(blah blah blah);
if ($mail) {echo "mail sent";}
if (!$mail) {echo "mail not sent";}

Posted: Sat Sep 11, 2004 11:08 pm
by m3mn0n
Have a read: [php_man]mail[/php_man]