我需要在HTML电子邮件中创建一个“转发给朋友”的链接,该链接将模拟邮件客户端上的转发按钮(即启动一个新窗口,并填充正文),这是否可能?
例如:
<a href="forward-action">将此电子邮件转发给朋友</a>
如果不行,有什么简单的方法可以实现尽可能相似的结果吗?
注:我知道这基本上是没有意义的功能,这是客户的要求。
我需要在HTML电子邮件中创建一个“转发给朋友”的链接,该链接将模拟邮件客户端上的转发按钮(即启动一个新窗口,并填充正文),这是否可能?
例如:
<a href="forward-action">将此电子邮件转发给朋友</a>
如果不行,有什么简单的方法可以实现尽可能相似的结果吗?
注:我知道这基本上是没有意义的功能,这是客户的要求。
我不知道你的客户是否会接受这个方案:
创建一个时髦的“转发给朋友”按钮。
该按钮应打开客户网站上的一个页面。
该页面应包含一个“电子邮件给朋友”的表单。
更容易实现。
目前市场上的所有邮件客户端(Web或桌面)都无法模仿或发起转发操作。不过,您还有其他几个选项可用:
Offer an online version of your email and include a link to it in your mailto
tag:
<a href="mailto:Enter%20an%20email?subject=Your%20Subject%20Line&body=Thought%20you%20might%20be%20interested%20in%20this%20http://www.yourdomain.com">
Forward to a friend</a>
Include a callout in your email (near the top, preferably) encouraging your recipients to forward the message to their friends.
Include a link to a web form where your recipients can provide other people's email addresses and send these new email addresses copies of the mailing. (The only issue with this one is that the recipient's address book is not available to them easily, which probably hinders sharing - test to know what your demographic is like).
<a href="mailto:person@example.com">Link</a>
但这可能不是您想要的。所有这个做的就是打开撰写邮件页面,并填写电子邮件字段(假设他们的默认电子邮件客户端已配置为这样做)。
您可以尝试以下方法:
<a href="mailto:person@example.com?subject=FW: Email Subject
&body=Body of email text
&cc=anotherperson@example.com
&bcc=onemore@example.com">Forward email</a>
请填写邮件对话框中的所有字段,但是您无法模拟转发功能。
<a href="mailto:person@foo.com?subject=..extracted subject...&body=...extracted body...">Forward</a>
一个主要的缺点是'a'标签内的整个URI不能超过1024个字符。 哦,还有在组成URI字符串时不要忘记对主题和正文进行URL转义。
无法进行转发。
但是我已经对此进行了一些研究,因为我想要推广一个活动。
我创建了以下链接:
<a href="mailto:?&subject=Webinar%20on+Leveraging+Artificial+Intelligence+to+Build+Algorithmic+Trading+Strategies&body=Check%20out%20this%20webinar%20on%20developing%20robust%20quantitative%20trading%20strategies%20using%20AI.%20http%3A//bit.ly/1MqTMzg" target="_blank">Spread the word</a>
希望能对你有所帮助!
我不是一名网站开发者,只是为自己编写网页。为了避免被机器人捕获用于垃圾邮件或其他目的,我已经停止直接将电子邮件地址放入HTML中。
相反,我编写了一个简单的JS来将信息片段连接在一起:
function ml(name, dom, sub, body) {
var mailname = name + "@";
var nl = "%C2%A0%0A";
var nlcol = "%3A" + nl;
var dom = dom + ".";
var msg = "mai" + "lto:" + mailname + dom + "com" + "?subject=" + sub + "&body=" + body;
window.location.href = msg;
}
在 HTML 中:
<a onclick="ml('emailName', 'domain Name', 'subject string', 'greeting in content or any text in content')" >
<input type="button" value="Share with a friend">
</a>
mailto:
的方法。 - lolbas