How to write e-mails in HTML and send it using Gmail ?
Last Updated :
25 Jul, 2024
In this article, we are going to learn that how users can write e-mails in HTML format and send them using Gmail. However, Gmail doesn't offer an HTML editor still we can send HTML templates in an e-mail using some tools and methods. Many people need to send an e-mail with HTML templates to others. By using the below methods, users will be able to send HTML formatted emails using Gmail. They don't need to use a third-party tool like Mailchimp, etc.
There are 3 methods to send HTML formatted email using Gmail.
- Copy & Paste HTML from the webpage to Gmail editor.
- By Using chrome's developer tool.
- By using the Chrome extension.
Method 1: Copy & Paste HTML from the webpage to Gmail editor
Gmail offers a "what you see is what you get" editor. If we paste the raw HTML code into the editor, the recipient also sees the same raw HTML code. So, Instead of adding the raw HTML, we need to copy the HTML code output from the web browser and past it into the Gmail editor. The below steps will help you to generate an HTML formatted e-mail.
Step 1: Create a new HTML file and add the below HTML code into that.
HTML
<!DOCTYPE html>
<html>
<head>
<title>Simple HTML webPage</title>
</head>
<body>
<h1>Welcome to GeeksforGeeks</h1>
<p>A computer science portal for geeks</p>
<img src=
"https://media.geeksforgeeks.org/wp-content/uploads/20210915115837/gfg3-300x300.png"
alt="GFG image" />
</body>
</html>
Â
Step 2: Open the HTML file in the web browser and Copy the HTML from there.
Step 3: Paste the HTML into the Gmail editor.Â
Step 4: Send the e-mail as you send normally it from Gmail.
Method 2: By using the chrome's developer tool
Chrome's developer tool allows users to edit the code of the webpage. Here, we will find the relevant element for the Gmail editor and add the HTML code to it. Users need to follow the below steps to use this method.
Step 1: Open the Gmail editor and right-click anywhere inside the editor.
Step 2: From the menu, click on the inspect option. You will see chrome's developer tool is opened and the HTML code of the Gmail editor.

Step 3: The user needs to find the div element with the "contenteditable=true" mark. Right-Click on the div element and choose edit as an HTML.Â
Step 4: Remove the code from the div element and add your HTML template code.

Step 5: Now, close the chrome's developer tool and you can see HTML is added to Gmail editor.
Method 3: By using the chrome extension
We will use the "Html inserter for Gmail" chrome extension to directly write an HTML code inside the Gmail editor. We just need to add a chrome extension to the chrome browser and Gmail will automatically show the option to write HTML code. To implement this method, follow the beneath steps.
Step 1: Add the Html inserter for Gmail chrome extension to chrome browser from here.
Step 2: Click on the HTML icon beside the send button.

Step 3: Add the HTML code here.Â

Step 4: Click on the Insert HTML button, and we have done.
Note: When you send an e-mail with an HTML template, you should not add CSS with an external CSS file, and web fonts. Furthermore, you have to use only online hosted and publicly available images inside the HTML template.
Output:
All the above 3 methods will give the same result as the below image. Now, users can send this HTML template to anyone like a simple e-mail.
Similar Reads
How to send email with Nodemailer using Gmail account in Node ?
Nodemailer is an npm module that allows you to send emails easily from the backend. In this article, we will cover the steps to send email using a Gmail account with the help of nodemailer. Prerequisites:NPM and NodeJSExpressJSApproach To send email with Nodemailer using gmailImport the nodemailer m
3 min read
How to Send Email using Mailgun API in Node.js ?
Sending an email is an essential part of any project and it can be achieved by using Mailgun API. It is very popular for sending emails. Features of Mailgun: . It is easy to get started and easy to use.It is a widely used and popular module for sending emails.Mails can also be scheduled. Installati
2 min read
How to Create a Link to Send Email in HTML ?
Incorporating email links into HTML pages facilitates a smooth way for users to send a message directly from the webpage. We will see how to create these email links, making your web pages user-friendly and interactive. Table of Content Using Mailto Protocol with Predefined SubjectCreating Link to s
2 min read
How to Send Email using 'git send-email' via Gmail?
Email communication is a crucial aspect of collaborative software development. Whether you're sharing patches, discussing issues, or coordinating with your team, knowing how to send emails directly from your Git repository can be highly efficient. In this article, we will guide you through the proce
3 min read
How to send Attachments and Email using nodemailer in Node.js ?
For this purpose, we will use a package called nodemailer. It is a module that makes email sending pretty easy. For using it, you will need to install by using the following command:Â $ npm install nodemailer Features of nodemailer module:Â It has zero dependencies and heavy security.You can use it
2 min read
How to Insert Email Address into Form using HTML5 ?
In this article, we will learn how to add and get an email address of a user as data of the form by adding an email input field. As we know that an email_id is a vital component of user data. Email address is used for the verification of the user. It is also used to make contact with the submitters
2 min read
How to Create Mail and Phone Link in HTML?
The HTML provides mailto and tel attributes to create the mail and phone links. We can use them in href to create the links. The href provides other sub-attributes that define the other properties of the mailto and phone link. Creating a Mailto LinkA mailto link is an easy way for users to contact w
2 min read
How to send a report through email using Selenium Webdriver?
In the world of automation testing, generating and sharing test reports is crucial. After executing tests using Selenium WebDriver, it's often necessary to share the results with team members or stakeholders. Automating the process of sending these reports via email can save time and ensure that eve
4 min read
How to Insert Spaces/Tabs in Text using HTML and CSS?
When building web pages, controlling the spacing between elements and text is essential for creating visually appealing and well-structured content. HTML and CSS offer several ways to insert spaces and tabs in text. While HTML provides basic methods for adding spaces, CSS gives more control over lay
4 min read
How to Build a Website using HTML?
Building a website using HTML (Hypertext Markup Language) is the foundation of web development. HTML allows you to structure content, define headings, paragraphs, lists, and links, and create visually appealing web pages.In this article, we'll learn the fundamentals of How to build a Website using H
5 min read