Simple ahref mailto syntax in html
Last Modified at 2019-06-25 21:29:28
The HTML mailto protocol allows you to make a hyperlink that will open your default email software and enables you to send messages to a specific address. For example, Outlook, but you have not installed it then if you are using chrome browser and you are logged into your Gmail account, then it will open a new message box where you type your message and send it to recipients.Examples:
Simple mailto syntax: Sometimes, we don't have enough
Mailto syntax with subject:
<a href="mailto:firstname.lastname@example.org">Email Me</a>
Addding 'Hi akhilesh' message as a subject.
Mailto syntax with subject and body:
<a href="mailto:email@example.com?subject=hi%20akhilesh">Email Me</a>
If you want to add some predefined body content and subject then use below code. Here in this example, i am adding 'Hi akhilesh' as a subject and 'How are you' as a body content.
Mailto syntax with Cc and Bcc:
<a href="mailto:firstname.lastname@example.org?subject=hi%20akhilesh&body=How%20are%20you?">Email Me</a>
By using below code you will be able to add cc and bcc recipients.
Mailto syntax with multiple addresses:
<a href=“mailto:email@example.comfirstname.lastname@example.orgemail@example.com”>Email Me</a>
If you required to send email to multiple recipient then you will add recipient email ids with comma separated. You can add any number of email ids there is no restrictions. You can also add subject content body attributes if you want.
I hope this small basic tool will help you. Thanks for reading my post.