简体   繁体   English

如何使用mailto发送html?

[英]how to send html with mailto?

I have the following html form... 我有以下HTML表单...

<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... 和我的JavaScript看起来像这样...

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? 为了使HTML标签能够在电子邮件中呈现,我需要如何处理此代码? Because as of right now, it simply shows the element tags along with the content. 因为到目前为止,它仅显示元素标签和内容。

Thanks for any advice! 感谢您的任何建议!

You can set the Mail Content Mime-type to be HTML, the page will be rendered. 您可以将邮件内容的Mime类型设置为HTML,页面将被呈现。 This would work only if the content is generated from server-side. 仅当内容是从服务器端生成时,这才起作用。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM