KidsLovePC Contact Us
  Home   PHP  Graphics ASP  JavaScript   J2EE  HTML  JAVA   Swing   Webtip  Forums  Lyric  Free sheet music  Ringtones

Send mail in PHP

If you want to start a image hosting business read the following lesson first:

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 HTML style.

You may use the following sendMail.php to fulfill this task.


//get user email
$to =$_GET['email'];
// subject
$subject = 'Image saving receipt';

// message
$message = "<html>".
" <title>Image saving receipt</title>".
"<img src=\"$imageid\">".
"<br>Your image url is$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 <>' . "\r\n";

// 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.php? . This is assume saved image's id =24 and you know the client email address.


PHP Calendar
Comprehensive PHP Web Calendar
Configurable PHP Calendar
PHP Calendar
PHP Image Processing
PHP grahic softwares
PHP create real-time dynamic chart
create antispam image(image verification)
Add water mark to image
PHP Image processing introduction
Add text on Image
Create thumbnail for image
Create image from text on fly
PHP code sample
PHP create dynamic PDF with FPDF
PHP create dynamic PDF with PDFLib
PHP create dynamic PDF with ClibPDF
Improved PHP configurable hit counter
Install phpMyAdmin,MySql, PHP
PhpMyAdmin export/import data
A simple PHP RSS feed reader
PHP include (SSI)
Working with Forms
PHP formmail Generator
Using phpMyAdmin Create Database
Insert Form Data into Database
Retrieve data from Database
Retrieve multiple records
Batch insert text using phpMyAdmin
Using phpMyAdmin insert binary file
Insert binary file using PHP code
Using form insert binary file into MySQL
Retrieve binary file from MySQL
Image hosting business in minutes
Send HTML mail in PHP
Send bulk emails in PHP
Polling/Rating System in PHP
Polling/Rating System in PHP(radio button)
Check visitor's IP address
Check reciprocal link
PHP tutorial
What is PHP?
Install PHP on Windows XP (part1)
Install PHP on Windows XP (part2)
PHP open and closing tags
PHP types
Logic Structures
Include files
Set cookie and delete cookie
Most often used MySQL functions



Printer Inkjet A Z lyricsLearn ChineseHome|PHP|Swing|HTML|JavaScript|ASP|JAVA|Forum|WebTip|Contact Us
Copyright © All rights reserved(new). Privacy|Copyright
designed by

Please help us cover the web site maintenance fee.
barcode scanner Thermal Printer credit card machine bar code printer