AOW >> HTML, CSS Contents In PHP Mail
PHP (1)

HTML, CSS Contents In PHP Mail

HTML, CSS Contents In PHP E-Mail. How send the HTML and CSS contents using the PHP. Now days trends of the send colorful emails from website is very high. And I will show you in this tutorial how you send the HTML and CSS contents using the PHP.

Example code of sending mails through PHP is following:

<?php

$to = "test@test.com"; // email address

$subject = "HTML Contents In Email"; // subject of the email

// message of the eamil which contains the HTML Tags and contents
$message = "
<html>
<head>
<title>Test email</title>
</head>
<body>
<p style='color:lime;'>This email contains HTML contents!</p>
<p>Keep visitng <a href='http://alloverwebs.com'>alloverwebs.com</a> for more tutorails</p>
</body>
</html>
";

// Always set content-type when sending HTML email and this is very important part of the HTML email using PHP
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers addional 
$headers .= 'From: <test_website@test.com>' . "\r\n";
$headers .= 'Cc: test_admin@test.com' . "\r\n";

// PHP mail function for sending the emails
mail($to,$subject,$message,$headers);

?>

Complete video tutorial:

Likes(1)Dislikes(0)
Please follow and like us:

Leave a Reply

Your email address will not be published. Required fields are marked *


*