Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Cursor position in html mailto link

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?

like image 408
user2353513 Avatar asked Oct 10 '13 00:10

user2353513


People also ask

How do I code a mailto link in HTML?

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.

How do I redirect mailto in HTML?

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.

How do I put subject and body in mailto link?

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.


1 Answers

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.

like image 66
Sasidhar Vanga Avatar answered Oct 19 '22 23:10

Sasidhar Vanga