我想通过ShellExecute函数启动默认的电子邮件客户端应用程序。如何在“mailto”协议中使用unicode?
即我写这样的东西:
ShellExecute(0,'mailto:[email protected]?subject = example & body = example',...);
如何在主体和主体中编码非US字符?
我不能使用默认的ANSI代码页,因为字符可以是任何东西:汉字,西里尔文或其他东西。
P.S.备注:
- 我正在使用ShellExecuteW函数。
- 离开主题和身体“照原样”将不起作用(在WinXP上使用Win7和Outlook Express上的Windows Live Mail客户端进行测试)。
- 作为URLEncode(UTF8Encode(Subject))编码主题将适用于Windows Live Mail,但不适用于Outlook Express。
- URLEncode(UTF8Encode(Body))不适用于两个客户端。
好吧,所以简短的回答是:“使用UTF-8格式的%-encoding”(所以我几乎是这样做的)。如果你有垃圾 - 扔掉你的电子邮件客户端:D – Alex 2010-02-01 19:01:32
你可能想看看这个:http://stackoverflow.com/questions/4458939/mailto-href-not-working-as-expected-in-browser/4459102#4459102 – 2010-12-17 05:11:01