Simple ahref mailto syntax in html

No comments
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
<a href="mailto:akhilesh@example.com">Email Me</a>
Mailto syntax with subject: Addding 'Hi akhilesh' message as a subject.
<a href="mailto:akhilesh@example.com?subject=hi%20akhilesh">Email Me</a>
Mailto syntax with subject and body: 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.
<a href="mailto:akhilesh@example.com?subject=hi%20akhilesh&body=How%20are%20you?">Email Me</a>
Mailto syntax with Cc and Bcc: By using below code you will be able to add cc and bcc recipients.
<a href=mailto:akhilesh@example.com?cc=john@example.com&bcc=hi@example.com>Email Me</a>
Mailto syntax with multiple addresses: 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.
<ahref="mailto:akhilesh@example.com,john@example.com,hi@example.com">Email Me</a>

I hope this small basic tool will help you. Thanks for reading my post.

No comments :

Post a Comment