How to create a button "Current Email Page" in HTML?

Desired target: I’m trying to create a “Current Email Page” button to go to my website. These are the necessary functions:

  • It must be universal in order to fit any page on which the button is located (i.e. different articles that I post on my site, etc.).
  • It should not automatically install recipients
  • It should have a fixed subject line
  • It should have the main text, which includes a link to the current page (again, not a fixed link, but a universal link that adapts to any page on which the button is activated).
  • Finally, the email button should be visible on the web page as an image icon.

I am a general html newbie (my experience is several days of playing wordpress), so I know absolutely nothing. This is what I came up with (which obviously doesn't work):

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

According to www.w3schools.com/html/, that was wrong, lol. I tried to fix it, but I just ruin it more. Please advise! I changed the links to remove personal information about the company and replaced it with generic things like Google, etc. Please tell me what I did wrong and what I need to do to fix it. Thank you very much!

PS - would it be better to make a shape? If so, where to start? Can I use a button as a link to a form? Thank you for help.

+4
source share
2 answers
 <html> <head> <title>My Page</title> <script language="javascript"> function emailCurrentPage(){ window.location.href="mailto:?subject="+document.title+"&body="+escape(window.location.href); } </script> </head> <body> <a href="javascript:emailCurrentPage()">Mail this page!</a> <body> </html> 

Enjoy it!

+11
source

I would look at a third-party tool, such as AddThis, which supports sharing via email and social networks:

http://www.addthis.com/

There is a special WordPress plugin or you can add a standard widget to any web page.

0
source

Source: https://habr.com/ru/post/1434896/


All Articles