Html mail template example
Here is an example of an HTML email template:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Email Template</title>
<style>
/* Add some basic styling to make the email look decent */
body {
font-family: Arial, sans-serif;
font-size: 16px;
line-height: 1.5;
padding: 0;
margin: 0;
}
img {
max-width: 100%;
height: auto;
display: block;
margin: 0 auto;
}
</style>
</head>
<body>
<table width="100%" cellpadding="0" cellspacing="0" border="0">
<tr>
<td align="center">
<table width="600" cellpadding="0" cellspacing="0" border="0" style="background-color: #f9f9f9; border: 1px solid #ddd; padding: 20px;">
<tr>
<td>
<h1 style="color: #333; font-weight: bold; margin-bottom: 10px;">Email Template Example</h1>
<p style="color: #666; font-size: 14px; margin-bottom: 20px;">This is an example of an HTML email template.</p>
<img src="image.jpg" alt="Image" style="width: 200px; height: 100px; margin-bottom: 20px;">
<p style="color: #666; font-size: 14px; margin-bottom: 20px;">You can add more content, images, and links to this template.</p>
<a href="https://www.example.com" style="text-decoration: none; color: #337ab7; font-weight: bold; padding: 10px 20px; border: 1px solid #337ab7; border-radius: 5px; background-color: #337ab7; color: #fff;">Learn More</a>
</td>
</tr>
</table>
</td>
</tr>
</table>
</body>
</html>
This template includes:
- A basic HTML structure with a
<head>
and a<body>
- A
<style>
block to add some basic styling to the email - A
<table>
element to contain the email content - A
<tr>
element to contain the email header - A
<td>
element to contain the email content - An
<h1>
element to display the email subject - A
<p>
element to display the email body text - An
<img>
element to display an image - An
<a>
element to create a link
You can customize this template to fit your needs by adding or removing elements, and by modifying the styles and content.
Note: When sending an HTML email, it's a good idea to include a plain text version of the email as well, in case the recipient's email client doesn't support HTML emails.