0

I have the following html form...

<form id="mform"  method="get" enctype="text/plain">
<input name="firstname" type="text" id="firstname">
<input type="submit" class="submit-sponsor-btn" name="submit" value="Submit"  onclick="javascript:doMailto(); return false;" id="submit">
</form>

and my javascript looks like this...

var msubject = "Become an sponsor to start your connection to future talent";
var mfirstname = $('#firstname').val();
var mbody = "<h1>Sponsor Information Below:</h1><p>Firstname:"+mfirstname + "</p>";
var sMailto = "mailto:memail@something.com?subject="+ msubject + "&body="+ mbody;

 function doMailto() {
      window.open(sMailto);
   }

What do I need to do with this code, to enable HTML tags to be rendered within the e-mail? Because as of right now, it simply shows the element tags along with the content.

Thanks for any advice!

klewis
  • 7,459
  • 15
  • 58
  • 102
  • You would need to send a header of `"Content-type : text/html"` somehow – Logan Murphy Aug 07 '13 at 17:33
  • There's really no generally-reliable way to get a client email agent to do anything in particular; you really can't even rely on the "body" parameter being recognized. What you'd need to do here is convince the mail agent that the content is supposed to have the HTML MIME type. – Pointy Aug 07 '13 at 17:33

1 Answers1

0

You can set the Mail Content Mime-type to be HTML, the page will be rendered. This would work only if the content is generated from server-side.

kamal079
  • 68
  • 6
  • where in my html file do i set that? – klewis Aug 07 '13 at 17:37
  • And how exactly would one go about doing that, @kamal079? – Pointy Aug 07 '13 at 17:38
  • Sorry, I didn't read your question thoroughly. I don't think it is possible from within Javascript, this has been answered here - http://stackoverflow.com/questions/5620324/mailto-with-html-body – kamal079 Aug 07 '13 at 21:26