iamjustcoder
iamjustcoder

Reputation: 4852

How to pass request URL to mailto body

I need to pass URL to the body part of the mailto link. Sample URL :

www.test.com?param1=value1&param2={value2}

If i pass this URL, it's cut down after the '&'. So, i have tried to encode the URL like below:

www.test.com%3Fparam1%3Dvalue1%26param2%3D%7Bvalue2%7D

It works, but the URL is not readable. How can we achieve this without encoding or showing readable URL in the mail body?

Upvotes: 0

Views: 1713

Answers (2)

Nuno Machado da Silva
Nuno Machado da Silva

Reputation: 11

Try this bit of code:

<a href="mailto:?subject=this is a subject&body=[sub]" onclick="this.href =this.href.replace('[sub]',window.location)">Send Mail</a>' with current webpage (offline mode will send file location on disk).

Upvotes: 1

Diodeus - James MacFarlane
Diodeus - James MacFarlane

Reputation: 114377

When is doubt, read the specification:

http://shadow2531.com/opera/testcases/mailto/modern_mailto_uri_scheme.html

Validator available at the bottom of the page.

Upvotes: 0

Related Questions