Ad block is installed and active. Please support us by disabling it.
HomeThursday, September 21, 2017, 03:14:19

Sending HTML Email With Images - PHP Tutorial

Tuesday, February 10, 15, 12:06:50, 3 Yaers Ago Via wain, Hits: 6600
Sending HTML Email With Images - Upload Image with PHP - Creating Dynamic Webpages Using PHP and MySQL - Select, Delete, Update..

<form name="myform" action="mail.php" method="POST">
<input type=text name="to" size="25"><br>
<strong>Your Message</strong><br/>
<input type=text name="msg" size="25"><br>

<input type="submit" value="Submit">
<input type="reset" value="Reset">


$message = $_POST['msg'];
//mail body - image position, background, font color, font size...
$body ='<html>
background: #fff;
font-family: "lucida grande", tahoma, verdana;
font-weight: bold;
color: #fff;
background-color: #336699;
margin: 10px;
<div class="content">
<h1>My HTML Mail</h1>
'.$message.'<br />
<img src="" /><br />
//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: System Admin <>' . "\r\n";
$to = $_POST['to'];
$subject = "My HTML Mail";
//mail function
$mail = mail($to, $subject, $body, $headers);
if(!$mail) {
echo "Error sending email";
} else {
echo "Your email was sent successfully.";

michael Tuesday, February 10, 2015, 14:22:57

@wain great tutorial! Thanks

Sign In



Upload Attachment - PHP Tutorial

Upload attachment with PHP example, Requirement(s): PHP server

PHP Redirect

Header (location) redirect must be processed before any output to the browser.

Jquery - Formatting International Phone Numbers

How to format international telephone numbers with jquery

Upload Image With PHP

[Example3] Tutorial - How to upload image in php.

Contact Us 2.0. :: PHP Form

Version 2.0. - A contact us form with email and form field validation. It allows your visitors to send you an email directly from your website.

Site Recommendation

This script will allow your visitors to recommend your site to their friends.

PHP Form Action Self Submit

PHP form action self submit tutorial, requirement(s): PHP server

Jquery PHP Contact Form

This script allows your visitors to send you an email directly from your website.

Captcha V1 - Free PHP Script

An anti-spam form protection image written in PHP, Version: 1.1.


Getimagesize function will determine the size of any given image file and return the dimensions along with the file type and a height/width text string to be used inside a normal HTML IMG tag and the correspondant HTTP content type.
About Author


Date Registered: Sun, Feb 8, 15
Last Time Online: Thu, Jun 15, 17
So far has created 115 entries.
This author has not yet filled in any details.