Send Beautiful Emails Using HTML And PHP

To Send Beautiful Emails It Takes Only One Step:-
  1. Make a PHP file and define scripting,markup and styling

Step 1.Make a PHP file and define scripting,markup and styling
We make a PHP file and save it with a name email.php
<?php

$to   = "receiver_email";
$from = 'your_email';

$subject = "You Got Mail From rajdeephalvadiya.blogspot.in"; 

$headers = "From: " . $from . "\r\n";
$headers .= "Reply-To: ". $from . "\r\n";
$headers .= "CC: your_email\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";
  
$message = '<html><body>';
$message .= '<h1>Mail From rajdeephalvadiya - Thanks for Subscribing</h1>'; 
$message .= '<table width="100%"; style="border:1px solid grey;" cellpadding="15">';
$message .= "<tr><td>Home Page</td><td><a href='http:///rajdeephalvadiya.blogspot.in'></a></td></tr>";
$message .= "<tr><td colspan=3>Dear Receiver_Name,</td><td>Thanks For Subscribing rajdeephalvadiya.blogspot.in Now You can Access Much More And Premium Features.</td></tr>";
$message .= "</table>";
$message .= "</body></html>";
  
mail($to, $subject, $message, $headers);

?>

In this step we use php built in mail() function to send email.In this we insert some headers which is required to send HTML emails and then we use some HTML and styling in message to make our message more attractive.You can use any kind of markup in email but make sure to add there required headers otherwise your email is not going to be send.You may also like send mail with attachments using PHP.

Thats all, this is how to send beautiful Emails using HTML and PHP.You can customize this code further as per your requirement. And please feel free to give comments on this tutorial.