Subscribe For Free Updates!

We'll not spam mate! We promise.

Jul 7, 2013

Sending Nice HTML Email with PHP


Sending Nice HTML Email with PHP :





   Everyone wishes to include Html content in their mails. Here is a sample code to send a mail with HTML content. You can edit the HTML content as you prefer.


$to = 'sample@example.com';

$subject = 'Sample HTML content';

$headers = "From: " . strip_tags($_POST['req-email']) . "\r\n";
$headers .= "Reply-To: ". strip_tags($_POST['req-email']) . "\r\n";
$headers .= "CC: susan@example.com\r\n";
$headers .= "MIME-Version: 1.0\r\n";
$headers .= "Content-Type: text/html; charset=ISO-8859-1\r\n";

$message = '<h1>';';
$message .= '<a href='http://techniqzone.blogspot.in/'>TechniqZone</a> Is Help To Guide Developers issues.';
$message .= '</h1>';
mail($to, $subject, $message, $headers);


$message contains HTML content. And the HTML content will be executed in the mail.

TechniqZone Socializer Widget
SOCIALIZE IT →
FOLLOW US →
SHARE IT →

0 comments:

Post a Comment