简体   繁体   English

如何使用JavaScript将链接的文本添加到电子邮件中?

[英]How can I add a linked text to email with JavaScript?

I'm trying to add a linked text to a JavaScript generated email such as: Hi, here is some text that if you'll click on, will bring you to some web page 我正在尝试将链接文本添加到JavaScript生成的电子邮件中,例如: 嗨,这是一些文本,如果您单击该文本,会将您带到某些网页

I don't care much about the format (Underline or bold etc.). 我不太在乎格式(下划线或粗体等)。

I found some threads regarding using HTML, but also found that it is not always working (depends on default mail). 我发现了一些有关使用HTML的线程,但也发现它并不总是有效(取决于默认邮件)。

Is there any way I can do it using my mailto: value? 有什么办法可以使用我的mailto:价值吗?

You can add only a plain text into mailto's body: 您只能在mailto的正文中添加纯文本:

<a href="mailto:someone@example.com?subject=SUBJECT&cc=test@example.com&body=BODY">SEND</a>

The "body" should contain the content for the first text/plain body part of the message. “正文”应包含邮件的第一个文本/纯文本正文部分的内容。 The mailto URL is primarily intended for generation of short text messages that are actually the content of automatic processing (such as "subscribe" messages for mailing lists), not general MIME bodies [source] mailto URL主要用于生成短文本消息,这些文本实际上是自动处理的内容(例如邮件列表的“订阅”消息),而不是常规的MIME正文[source]

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

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