user1680918 user1680918 - 5 months ago 8x
HTML Question

How do I make an "email current page" button in HTML?

The desired goal: I am trying to make an "email current page" button to go on my website. These are the necessary functions:

  • It should be versatile to match any page the button is on (ie different articles I put up on my site, etc)

  • It should have no recipients set automatically

  • It should have a fixed subject line

  • It should have body text that includes a link to the current page (again, not a fixed link, but a versatile link that adapts to whatever page the button is activated on).

  • Lastly, the email button should be visible on the webpage in the form of an image icon.

I am a total html novice (my experience amounts to a few days of playing around on wordpress) so I know absolutely nothing. This is what I came up with (which clearly doesn't work):

<a href="MAILTO:?subject=Check out this company&body=Check out <a title="this site" href="">this company</a>. They are a search engine. I thought this might be of interest to you. " target="_blank"><img src="… /></a>

According to this was way wrong, lol. I have tried to put it right but I'm just wrecking it more. Please advise! I've changed the links to remove personal company info and replaced it with generic things such as google, etc. Please tell me what I've done wrong and what I need to do to fix it. Thanks so much!

PS - would it be better to do a form? If so, where do I start? Can I still use the button as a link to the form? Many thanks for the help.

    <title>My Page</title>
    <script language="javascript">
        function emailCurrentPage(){
        <a href="javascript:emailCurrentPage()">Mail this page!</a>