0

I need to make a very basic button, that when clicked sends a particular person an email letting them know that that particular page has a broken pdf embed.

In otherwords, the user view a page containing an embeded pdf. If the pdf is broken, they will click a button. Someone will get an email saying like "page (insert full page url here) has a broken pdf embed". I cannot use PHP because this is to be deployed on a non-php server.

Ok so if I use a mailto tag like this:

 <p><a href="javascript:void(window.open('mailto:test@example.com?subject=subject&body=body'))">click here</a></p>

How do I get the full url path into the body of the message?

Chris
  • 1,881
  • 3
  • 20
  • 27
  • javascript can't send emails. One option would be to have "mailto: ..." in the href of your anchor. – Andrew Feb 03 '12 at 18:05
  • You cannot sent emails with javascript, you need some kind of server-side technology. – bfavaretto Feb 03 '12 at 18:06
  • possible duplicate of [send email with javascript](http://stackoverflow.com/questions/7381150/send-email-with-javascript) – Felix Kling Feb 03 '12 at 18:06
  • So if I go the mailto route, how to I configure it so that when they send the message it automatically has the URL in the message? – Chris Feb 03 '12 at 18:06
  • @Andrew: See edit on question – Chris Feb 03 '12 at 18:15
  • @Chris once you have the full url (you can extract it using JavaScript and capture it in a variable) you can assign it to body(you already have subject and body). – Andrew Feb 03 '12 at 18:18
  • @andrew how do I do that. I'm not sure how to get the URL into javascript, nor how to add the variable in there. – Chris Feb 03 '12 at 18:20

1 Answers1

1

This is a way to get the URL and pass it to mailto

<p><a href="javascript:void(window.open('mailto:test@example.com?subject=subject&body='+window.location.href+''))">click here</a></p>
Andrew
  • 6,254
  • 16
  • 59
  • 93