Home > Back-end >  mailto: put in the mail body a link but not showing the url
mailto: put in the mail body a link but not showing the url

Time:12-24

It's about the fact that I don't want to show the full link in an email, but a short text where the link is stored. If you click on "Open Link" you should be redirected to the URL. The text "Open Link" should also be bold. I am using Angular.

<a
href="mailto:[email protected]?subject={{this.mailService().template(receiver).subject}}&body={{this.mailService().template(receiver).body}}" target="_top">
public template(receiver) {
return new Mail(

`Subject: Open Link`,

`Body:`  
`Open Link`
);

}

Outlook opens for me and the subject and body text is displayed. I just want the link not to be fully displayed in the subject and body, but to be stored behind a text.

As seen here:

enter image description here

I've also tried it with HTML code in my template method. HTML is not recognized.

<a href="https://www.stackoverflow.com">Open Link</a>

I've already googled but found nothing about my problem. https://www.google.com/search?q=mailto hyperlink with body

CodePudding user response:

This is not possible, because the mailto link can only contain plain text, not HTML.

From RFC 6068:

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.

  • Related