简体   繁体   中英

How to add page URL in HTML mailto: subject and body.?

How to add page URL in HTML mailto: subject and body.

Even some dynamic variable values need to be added.

Thanks in advance

You can use the mailto in the url as :-

<a href="mailto:someone@example.com?Subject=Hello%20again">

It contains the recipients address and the subject... I hope this helps... :)

You can use this

        <body>

         <p>
          This is an email link:
         <a href="mailto:someone@example.com?Subject=Hello%20again">
                    Send Mail</a>
                   </p>



        </body>
        </html>

Note: Spaces between words should be replaced by %20 to ensure that the browser will display the text properly.

It's easy to add a subject and body message. I find it works OK without %20 between each word, but it's probably safer to use it. So you can either try this:

<a href="mailto:email@mysite.com?subject=Hi there&amp;body=This is my body message">Email Us</a>

or this

<a href="mailto:email@mysite.com?subject=Hi%20there&amp;body=This%20is%20my%20body%20 message">Email Us</a>

Note that I used &amp; rather than & , as just an & tends to be disliked in URLs. (It doesn't validate, anyhow.)

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM