html mail code example

Example 1: html mailto

<a href="mailto:[email protected]">Link text</a>

Example 2: html email links

<a href="mailto:[email protected]"> Email_id </a>

Example 3: php mail

<?php
$to = $_POST['email'];
$subject = "Email Subject";

$message = 'Dear '.$_POST['name'].',<br>';
$message .= "We welcome you to be part of family<br><br>";
$message .= "Regards,<br>";

// Always set content-type when sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";

// More headers
$headers .= 'From: <[email protected]>' . "\r\n";
$headers .= 'Cc: [email protected]' . "\r\n";

mail($to,$subject,$message,$headers);
?>

Example 4: html tag email

<a href="mailto:[email protected]">Contattaci</a>

Example 5: html mail

<a href="mailto:[email protected]">Mail me!</a>

Example 6: html open email program

<a href= "mailto:[email protected]">Send Email</a>

Tags: