Html mailto body
The mailto
HTML tag!
The mailto
tag is used to create a hyperlink that, when clicked, opens the user's default email client with a pre-filled email message. The tag is used to specify the email address, subject, and body of the email.
Here is the basic syntax:
<a href="mailto:[email protected]?subject=Subject&body=Body">
Send Email
</a>
Let's break it down:
mailto:
is the protocol used to open the email client.[email protected]
is the email address to which the email will be sent.subject=Subject
specifies the subject of the email.body=Body
specifies the body of the email.
You can customize the mailto
tag to include additional parameters, such as:
cc
to specify a carbon copy recipient:[email protected]
bcc
to specify a blind carbon copy recipient:[email protected]
to
to specify additional recipients:[email protected]
from
to specify the sender's email address:[email protected]
Here's an example with multiple parameters:
<a href="mailto:[email protected]?subject=Subject&body=Body&[email protected]&[email protected]&[email protected]&[email protected]">
Send Email
</a>
Keep in mind that the mailto
tag is not supported in all email clients, and some clients may not support all the parameters. Additionally, the mailto
tag is not secure, as it can be used to send unsolicited emails (spam).
It's also worth noting that the mailto
tag is not recommended for use in modern web development, as it can be vulnerable to email harvesting and spamming. Instead, consider using a JavaScript-based solution or a server-side language like PHP to send emails programmatically.