简体   繁体   English

Mailto标签将文本放入电子邮件的“收件人”字段,而不是移动设备上的主题

[英]Mailto tag puts text into the “To” field of email instead of subject on mobile devices

When I use my mobile applications mailto tag on my desktop everything works great but when I access my app on my 2.3 android phone the body of my email gets crammed into the "To" field. 当我在桌面上使用移动应用程序的mailto标记时,一切正常,但是当我在2.3安卓手机上访问我的应用程序时,我的电子邮件正文被塞到“收件人”字段中。 Is there any issues with mobile browsers and the mailto tag? 移动浏览器和mailto标签是否存在任何问题? Am I setting up the email incorrectly? 我是否设置了错误的电子邮件? I have made sure the email message cannot exeed 1,000 characters fully escaped, I cant think of anything else that would be causing this. 我已确保电子邮件中不能完全逃脱1000个字符,我想不出其他任何原因。 Any help would be greatly appreciated. 任何帮助将不胜感激。

document.location.href = "mailto:&body=" + escape(myMessage.replace(/[^\u0000-\u007F]/, ""))

我相信mailto标记确实在做应做的事情,并将其放在“ To”字段中。有一个标记可以指定主题行。.虽然我不知道语法,但我不确定像简单的Google搜索那样为您设置正确的用法。

You may optionally specify the recipient of the message first. 您可以选择先指定邮件的收件人。

mailto:recepient@gmail.com

Next, the first parameter must be prepended by a ? 接下来,第一个参数必须以?开头? :

mailto:recepient@gmail.com?body=

Any further parameters (like to or subject) must be prepended by an & : 任何其他参数(例如to或subject)必须以&开头。

mailto:recepient@gmail.com?body=yourbody&subject=example

The mailto: must also be URL encoded, which I'm assuming you're doing in your escape() function. mailto:还必须经过URL编码,我假设您正在使用escape()函数。

More info at About.com 有关更多信息,请访问About.com

You need something like: 您需要类似:

document.location.href = "mailto:?body=" + escape(myMessage.replace(/[^\u0000-\u007F]/, ""))

note the question mark. 注意问号。

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

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