When using the additional parameters in a mailto:// hyperlink, the cursor is placed at the start of the message. Is it possible to set the starting position of the cursor to another location in the body text?
For example, consider the following HTML:
<a href="mailto://[email protected]?subject=Hello&body=Hello,%0D%0A%0D%0A%0This%20is%20an%20additional%20line%20of%20text...">Click Here To Email Me</a>
Clicking on the link will launch the end-user's default email client and (if the client supports it) will pre-populate the to field with [email protected]
, the subject field with Hello
and the body field with:
Hello,
This is an additional line of text...
The default positioning of the cursor (i.e. in OS X Mail.app) is at the beginning of the body, before the word "Hello".
How can the cursor be positioned after the ellipses, so the end-user can finish the message? Is that even possible?
You can create an HTML mailto link by using an anchor tag with the href attribute and inserting the “mailto” parameter after it. If you want to send an email to more than one address, separate your email address with a comma.
The most common way to link an email in HTML is by using an anchor tag that has a href attribute. The href will point to the email you would like to send the email to. This link will open up a new, blank email, addressed to you, in the users' email client.
If you want to add a subject to that e-mail add ? subject=<subject> to the mailto tag. For example, the complete tag would look similar to the example below. You can also add body text by adding &body=body to the end of the tag, as shown in the example below.
It is not possible.
When you click on any "mailto:" link, the browser will handle the request to any E-mail application, either a Desktop application like - Microsoft Outlook, Mozilla Thunderbird etc. or another browser tab like GMail.
In the "mailto:" link, we can set only the to, subject etc. But not any other information regarding the cursor position.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With