By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,844 Members | 1,895 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,844 IT Pros & Developers. It's quick & easy.

how to create a button to mail the webpage

P: 7
Hello,

I want to create a button that when clicked, the webpage will then be in the body of Microsoft outlook ready to be emailed. It is for our office maps. People here have difficulty using the file>send page as> of the internet explorer and demanded that a button be but but I cannot seem to make it work that way.

Please help.
Jul 6 '07 #1
Share this Question
Share on Google+
1 Reply


ak1dnar
Expert 100+
P: 1,584
This a simple example to do such a thing.This is enough for sending palin text. I didnt try it for rich text. You have to give it a try.

Thanks!- Ajaxrand

Expand|Select|Wrap|Line Numbers
  1.  <html> 
  2. <head>
  3. <script language="JavaScript" type="text/javascript">
  4. function mailIt(){
  5. var mailbody = document.getElementById("mailbody").innerHTML;
  6. window.location="mailto:info@domain.com?subject=Test Mail&body="+mailbody+"";
  7. }
  8. </script>
  9. </head>
  10. <body>
  11. <DIV id="mailbody">
  12. I want to create a button that when clicked, 
  13. the webpage will then be in the body of 
  14. Microsoft outlook ready to be emailed. 
  15. It is for our office maps. People here have 
  16. difficulty using the file>send page as> of the 
  17. internet explorer and demanded that a button be but 
  18. but I cannot seem to make it work that way.
  19. </DIV>
  20. <a href="#" onclick="javascript:mailIt()"><input type="button" value="Mail It"></a>
  21. </body>
  22. </html>
  23.  
Jul 6 '07 #2

Post your reply

Sign in to post your reply or Sign up for a free account.