简体   繁体   English

在mailto中处理双引号:

[英]Handling double quotes in mailto:

I am working on Visual Studio 2008 and ASP.net.. I want to preview email that is created in the web page. 我正在使用Visual Studio 2008和ASP.net ..我想预览在网页中创建的电子邮件。 I have problems in handling double quotes in the email body. 我在处理电子邮件正文中的双引号时遇到问题。

string emailbody = "\"some text\"";

btPreviewEmail.OnClientClick = "javascript:location.href='mailto:?subject=Chalk Pushcast Software Order Agreement&body=" + emailbody + "';";

I have left the recipient's field blank because I just have to preview the email. 我将收件人的字段留空了,因为我只需要预览电子邮件。

At runtime, I get a Microsoft Outlook error like, "The command line argument is not valid. Verify the switch you are using" 在运行时,我收到Microsoft Outlook错误,如“命令行参数无效。验证您正在使用的开关”

看起来你需要把它们放在url上,所以你可以简单地对它们进行URL编码(到%22 ):

string emailbody = "%22some text%22";

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

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