Jay
Jay

Reputation: 193

How do I pre-populate an email link with an html formatted email

If I wanted to prepopulate an email link like: (in a really simple format, pardon for the bad example.)

<a href="mailto:[email protected]?subject=About your bouncy ball&body=<img src='example.com/images/logo.png'>Hey Barney, Is your bouncy ball still for sale?">Email 3 Barney Today!</a>

and have the html actually show as html, is there a way to do so.

Upvotes: 1

Views: 8770

Answers (1)

stslavik
stslavik

Reputation: 3028

What you're looking to do is not part of the design of the mailto anchor href, according to RFC 2368:

The special hname "body" indicates that the associated hvalue is the body of the message. The "body" hname should contain the content for the first text/plain body part of the message. The mailto URL is primarily intended for generation of short text messages that are actually the content of automatic processing (such as "subscribe" messages for mailing lists), not general MIME bodies.

To do as you describe, you would be better off looking into a pre-processor like PHP.

Upvotes: 1

Related Questions