如何使用 JavaScript mailto 将签名添加到 Outlook 电子邮件中?
我正在使用 JavaScript mailto 函数用自定义文本填充电子邮件正文。
我可以在电子邮件中添加文本,但签名不显示。
有没有办法使用邮寄功能发送带有图像的自定义签名? 或者有什么方法可以在使用mail-to功能时在正文中插入HTML图像?
示例代码:
var message = "text of message";
var mailLInk = "mailto:[email protected]?subject=subject&body=" + message;
document.location.href = mailLink;
I am using JavaScript mailto function to fill an email body with custom text.
I can add text to the email but the signature doesn't show up.
Is there any way to send a custom signature with an image using mail-to function?
Or is there any way to insert an HTML image in the body when using the mail-to function?
Sample code:
var message = "text of message";
var mailLInk = "mailto:[email protected]?subject=subject&body=" + message;
document.location.href = mailLink;
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(3)
RFC 2368 的第 2 节表示
body
字段应该采用text/plain
格式,因此您不能执行 HTML。然而,即使您使用纯文本,某些现代邮件客户端也可能会将生成的链接呈现为可点击的链接。
Section 2 of RFC 2368 says that the
body
field is supposed to be intext/plain
format, so you can't do HTML.However even if you use plain text it's possible that some modern mail clients would render the resulting link as a clickable link anyway, though.
不,该信息存储在 Outlook 配置文件中。如何处理 URL 由 Outlook(或某些设置)决定。
No, that information is stored in the outlook profile. Its up to Outlook (or some setting) on how to deal with the URL.
目前还没有办法发送 html,因为只接受纯文本,我可以给你一些建议,为什么不使用 mailto 发送电子邮件:
HTML 中 mailto 的缺点
只有一个优点,它很容易创建并实施到网站中。但如果您想使用它,只需对您的邮件地址进行编码,这样垃圾邮件机器人就无法读取它。
但是,如果您想在邮件消息中添加页脚,则只需在正文参数中添加 %0A,%0A 是新行,您的光标将在那里闪烁,因此
?body=%0AT 那么您的页脚文本
将在电子邮件中给您页脚。:)
currently there is no way to send an html, because only plain text is accepted, and I can give you some tips why not to use mailto to send email:
Disadvantages of mailto in HTML
There is only one advantage and its easy to create and implement into web site. But if you want to use it just encode your mail address so it can't be read with spam bots.
But if you want to add footer in your mail message, then just in your body parameter add %0A, %0A is new line and your cursor will blink there so
?body=%0AThen your footer text
will give you footer in email.:)