People often get all worked up about getting the Php
mail function to work.
There are lots of complicated scripts out there to send mail but it really is not that hard.
Here is the simplest way to do it.
The Easiest Way to Send Mail with Php
mail( 'email@example.com', 'Subject Line', 'Text of the Message.' );
This is probably the quickest, easiest way of sending mail with Php. However,
you might want something more sophisticated. For example, maybe you want
to set the "from" address or the likes. Well here you go.
How to Send Extra Headers
// Put the info into some variables
$to_address = 'firstname.lastname@example.org';
$subject = 'Subject - Enquiry';
$extra_headers = "From: $NAME_OF_SENDER <$EMAIL_OF_SENDER>\r\n";
$extra_headers .= "Reply-To: $EMAIL_OF_SENDER\r\n";
$extra_headers .= "Return-Path: $EMAIL_OF_SENDER\r\n";
$message = 'Blah Blah Blah';
// Call the mail function with the variables.
mail( $to_address, $subject, $message, $extra_headers );
In this example the variables
$EMAIL_OF_SENDER would need to
be set before mailing. Normally you could use and HTML form element to pass the
data to the script and then send the email based on that.
Link back to this page
Copy and paste this HTML code into your page to link back to this very page:
Or just link to the WebCodingTech site:
And your link will look like this:
Copyright © 2005 WebCodingTech.com
Our URL is: