Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending mail

Status
Not open for further replies.

StevenK

Programmer
Jan 5, 2001
1,294
GB
I'm (very) new to PHP so this is possibly a very simple question.
I've seen the send_mail function - does this automatically send email (assuming parameters passed correctly) or do I need to have special set-ups on my server (that does allow the running of PHP and MySQL) ?
Any advice would be appreciated.
Thanks in advance
Steve
 
To make sure your sever is set-up for send mail just look at phpinfo();

Just make a simple PHP page like this:

<?php

phpinfo ():

?>

Run the script then look at the output it will tell you the path to send mail If all is ok then you can just use the mail(); function Regards
David Byng
spider.gif

davidbyng@hotmail.com
 
and since you are *very* new
the mail() function goes like this


mail($to, $subject, $message);

replace the $to, $subject, $address with whatever values you need.

Though I would suggest 'hard-wiring' the $to field to avoid mis-use of your mail server.

You can also add otehr header information to the mail() function. But I will leave that for you to look up as and when you need it.
 
EDIT:

replace the $to, $subject, $address with whatever values you need.


should read

replace the $to, $subject, $message with whatever values you need.


sorry, I am not used to not being able to edit my posts after I have submitted them. :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top