Is it possible to add an HTML link in the body of a MAILTO link
Section 2 of RFC 2368 says that the body
field is supposed to be in text/plain
format, so you can't do HTML.
However even if you use plain text it's possible that some modern mail clients would render a URL as a clickable link anyway, though.
mailto link with HTML body
As you can see in RFC 6068, this is not possible at all:
The special
<hfname>
"body" indicates that the associated<hfvalue>
is the body of the message. The "body" field value is intended to
contain the content for the first text/plain body part of the
message. The "body" pseudo header field is primarily intended for
the generation of short text messages for automatic processing (such
as "subscribe" messages for mailing lists), not for general MIME
bodies.
Inserting Link inside Mailto body
You can't have spaces in URLs so you must encode the space in the filename in order to create a URL to the file.
mailto:
URLs are URLs so an encoded space will be converted back to a regular space when it is parsed. When inserting one URL into an other, you must encode all the special characters in the nested URL (i.e. you need to convert the %
characters to %25
).
mailto link using computed property not loading full message body
You must URL-encode your data before assigning it to the HREF property of a hyperlink/anchor tag:
mailToString()
{
return "mailto:" + encodeURIComponent(this.formData.emailList) + "?subject=" + encodeURIComponent(this.formData.subject) + "&body=" + encodeURIComponent(this.emailContent);
},
Otherwise it might interfer with some reserved characters, e.g. ?
or =
or &
or some Unicode character.
Related Topics
How to Set Subject/Content of Email Using Mailto:
What Is Href="#" and Why Is It Used
How to Specify Line Breaks in a Multi-Line Flexbox Layout
Why Does the HTML Input With Type "Number" Allow the Letter 'E' to Be Entered in the Field
Heights Rendering Differently in Chrome and Firefox
Why Can't ≪Fieldset≫ Be Flex Containers
Masonry-Style Layout Only With Css
Css-Only Scrollable Table With Fixed Headers
Change Select Box Option Background Color
Float:Left; VS Display:Inline; VS Display:Inline-Block; VS Display:Table-Cell;
Align an Element to Bottom With Flexbox
Ie8 Support For CSS Media Query
Is It Sometimes Bad to Use ≪Br /≫
Overlay Opaque Div Over Youtube Iframe