Click to See Complete Forum and Search --> : sending emails in php code?????


java-lover
04-18-2005, 12:00 PM
how can i write a php code for sending email to someone
what should i use.....
would you help me please???

nix
04-18-2005, 12:27 PM
first you need a form to accept all the information, but I'll exclude that assuming you've already done that, or at least know how to do it.


$recipient = "your@email.com"; // this is the address the form is sending the email to. It's a concrete address, so unless you have $_POST['email']; instead, this address isn't going to change.
$subject = "Contact Form"; // this is the subject

/* these right here are just parts of the message, they are all optional and can be individually removed if not needed. Just remember to take them out of $input if you aren't going to use them*/
$name = $_POST['name']; //Get the title of the sender
$title = $_POST['title']; //Get the title of the sender
$company = $_POST['company']; //Get the company name from the form
$address = $_POST['address']; //Get the address from the form
$telephone = $_POST['telephone']; //Get the telephone number from the form
$fax = $_POST['fax']; //Get the fax from the form
$email = $_POST['email']; //Get the email from the form
$message = $_POST['message']; //Get the message from the form
$input = "Title: $title\n Name: $name\n Company: $company\n Address: $address\n Telephone: $telephone\n Fax: $fax\n $message\n\n You can contact me at: $email";
mail($recipient, $subject, $input); //Send the email


As simple as that. if you need anything explained, don't hesitate to ask.

java-lover
04-18-2005, 12:51 PM
thank you nix very much for your replay
you really helped me ...
can i ask another question????
do you know what i webct" web course teaching"???

nix
04-18-2005, 12:59 PM
do I know what i webct?

I'm sorry, but I don't quite understand. Could you perhaps rephrase that?

java-lover
04-18-2005, 01:04 PM
no problem.. ;)
webct is a web page that helps students for particular course by teaching
let say having exams or quizes on line ........
:confused: did i helped you???

nix
04-18-2005, 01:21 PM
nope, never heard of it or used it. but it does sound like a good idea. I'd like a place to brush up on my current lackluster skills, and hopefully build and learn new things. Do you have a link to it?

java-lover
04-18-2005, 01:56 PM
yes for sure
www.webct.com
but i am implementing a new webct for my university
it will be done in two weeks ...
it has two interfaces for student and another for the instructor
the student will have the ability to take exams , quizes but the instructor will add, delete, update questions for the database and viewing the student record and updating it , there will be like a chat room " edebate " between the students and instructors ,
but i want to add more tools that each of students or instructor can get the benifit of it .....
do you have any ideas..... :confused: