Simple Mail
$subject = "Test mail";
$message = "Hello! This is a simple email message.";
$from = "someonelse@example.com";
$headers = "From: $from";
mail($to,$subject,$message,$headers);
echo "Mail Sent.";?>
Html Mail (You can use images and other tags in mail)
// multiple recipients
$to = 'aidan@example.com' . ', '; // note the comma
$to .= 'wez@example.com';
// subject
$subject = 'Birthday Reminders for August';
// message
$message = 'Insert your html code here';
// To send HTML mail, the Content-type header must be set
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
// Additional headers
$headers .= 'To: Mary
$headers .= 'From: Birthday Reminder
$headers .= 'Cc: birthdayarchive@example.com' . "\r\n";
$headers .= 'Bcc: birthdaycheck@example.com' . "\r\n";
// Mail it
mail($to, $subject, $message, $headers);
?>
This entry was posted
on Tuesday, December 02, 2008
and is filed under
PHP
.
You can leave a response
and follow any responses to this entry through the
Subscribe to:
Post Comments (Atom)
.
About Me
- Shefeek Jinnah
- Ettumanoor, Kerala, India
- A normal guy next door.loves parents,frnds and MY Profession
My Scribblings
- College Life (1)
- Movie Reviews (2)
- Personal (2)
- PHP (1)
- Professional (1)
- Tech Updates (1)
0 comments