Send mail in
If you want to start a image hosting business read the following
This lesson shows how to send mail by PHP.
Send HTML mail
Assume you have opened image hosting business, like the lesson image
hosting business in minutes. After user insert an image, you want
to send your client email about the retrieving url and its image in
You may use the following sendMail.php to fulfill this task.
//get user email
$subject = 'Image saving receipt';
$message = "<html>".
" <title>Image saving receipt</title>".
"<br>Your image url is http://www.yoursite.com/script.php?id=$imageid".
// 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";
$headers .= 'From: Image saving <email@example.com>'
// Mail it
mail($to, $subject, $message,$headers);
In the above code, HTML header must be set for HTML mail. If you
don't set header, you just send a plain text file by calling mail($to,$subject,$message).
Here is how to use sendMail.php. Suppose after your saving script
saved image into database(see the lesson image
hosting business in minutes for the detail), just call sendMail.firstname.lastname@example.org&id=24 .
This is assume saved image's id =24 and you know the client email