Html email | send email using html - codewithrandom

Html email | send email using html - codewithrandom

html email | send email using html - codewithrandom


Hey friends, today I'll  teach how to send email using HTML! Btw, I'm CodingPorium and I make coding tutorials and provide Free Source Code on YouTube and Instagram.

HTML mail to link

Mailto

What is mailto? mailto is a type of syntax in anchor <a> tags. By using this syntax, we can make a click to email link easily. We need to add the following structure instead of a normal link in your anchor tag. Refer the structure below:


<a href="mailto:youremail@example.com"> Send Email </a>

This is a simple email link. When clicked, it will open your default email client app to open an email draft to the email address which you have set. Here's how the output looks like:


html email | send email using html - codewithrandom


Now let's see how to develop it even more.

email Subject using html

By just using mailto, you only can open a email draft to the email address which you have set. But we are now going to see how to make it have a default email subject too. We will use the ? subject attribute. Look at the code below:


<a href = "mailto:youremail@example.com?subject = Hello Friend!">
Send Email
</a>

When clicked, it will open your email app like this:

html email | send email using html - codewithrandom

Now we can make this even more complete by setting a default message also. Check the next section below.

email Message using html

Now let's make a complete working email link with email address, subject and now default message too. We will be using the &subject attribute in our mailto link. Check the code below:

<a href = "mailto:youremail@example.com?subject = Hello Friend!&body = "How are you?">
Send Email
</a>

Your email app will open like below when clicked:
html email | send email using html - codewithrandom


And that's all for this tutorial! You have made a successful working click to email link which consists elements like Subject, Email and Message.

written by @codingporium

Thanks for reading! Do contact me via the methods below if you have to say anything:

Post a Comment

Previous Post Next Post