Ad block is installed and active. Please support us by disabling it.
HomeWednesday, April 25, 2018, 08:52:24
13

Sending HTML Email With Images - PHP Tutorial

Tuesday, February 10, 15, 12:06:50, 3 Yaers Ago Via wain, Hits: 9823
Sending HTML Email With Images - Upload Image with PHP - Creating Dynamic Webpages Using PHP and MySQL - Select, Delete, Update..
Download:
http://osfiles.net/project/HTML-email

Example:
index.php
Code:
<form name="myform" action="mail.php" method="POST">
<strong>E-mail</strong><br/>
<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">
</form>


mail.php

Code:
<?php
//message
$message = $_POST['msg'];
//mail body - image position, background, font color, font size...
$body ='<html>
<head>
<style>
body
{
background: #fff;
font-family: "lucida grande", tahoma, verdana;
font-size:16px;
font-weight: bold;
color: #fff;
}
.content{
overflow:hidden;
background-color: #336699;
margin: 10px;
padding:10px;
}
</style>
</head>
<body>
<div class="content">
<h1>My HTML Mail</h1>
'.$message.'<br />
<img src="http://phpform.net/images/contact2.png" /><br />
</div>
</body>';
//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 <[email protected]>' . "\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

Sponsor

Related

Inserting form data in MySql table

Inserting form data in MySql table with PHP

PHP Form Action Self Submit

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

Random MySQL Query

Random MySQL query, requirement(s): PHP Server, MySQL

Link Base 2.0.

Manage your links using a MySQL database. It features easy install, user submission, and an admin panel to add, edit and remove categories and links.

Show / Hide Div with CSS

CSS Display and Visibility:The visibility property specifies whether or not an element is visible.

PHP explode

Explode — Split a string by string.

Captcha V2 - Free PHP Script

PHP Captcha protection image Version 2, - Requirement(s): PHP Server, GD Library

Send This Link PHP Script

A popup form which allows your visitors to send a referral link from your site. It features admin notification and HTML output.

Upload File with PHP

Basic file uploading with PHP

Comments 1.1. :: PHP Script

This script allows your visitors to add comments to any single page on your web site.
About Author

wain

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