在 iPhone 上通过 [UIApplication sharedApplication] 发送带有 html 标签的电子邮件
我正在尝试发送一封带有嵌入代码(html 片段)的电子邮件,但电子邮件正文为空。
NSURL *url = [NSURL URLWithString: me.emailUrl];
[[UIApplication sharedApplication] openURL:url];
NSLog(@"SnapShotViewController->infoAction: %@", url);
原始字符串看起来像这样。
最终的字符串看起来像这样。
mailto:?subject=SnapShot&body=%3Ciframe%20style%3D'width:320px;height:320px;border:0px'%20src%3D'http://snapserve.alphakanal.de/embed%3Fkey%3Db500bb47-e14d -405f-a70b-9779dbb8ce21'%3E%3C/iframe%3E
电子邮件应用程序打开但不显示正文。有什么想法吗?
I am trying to send an email with an embed code (html snippet) but the email body is empty.
NSURL *url = [NSURL URLWithString: me.emailUrl];
[[UIApplication sharedApplication] openURL:url];
NSLog(@"SnapShotViewController->infoAction: %@", url);
The original string looks like this.
<iframe style='width:320px;height:320px;border:0px' src='http://snapserve.alphakanal.de/embed?key=b500bb47-e14d-405f-a70b-9779dbb8ce21'>
The final string looks like this.
mailto:?subject=SnapShot&body=%3Ciframe%20style%3D'width:320px;height:320px;border:0px'%20src%3D'http://snapserve.alphakanal.de/embed%3Fkey%3Db500bb47-e14d-405f-a70b-9779dbb8ce21'%3E%3C/iframe%3E
The email app opens up but does not show the body. Any idea?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

在包含 HTML 的 NSString 上使用
- (NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)encoding
,如下所示:Use
- (NSString *)stringByAddingPercentEscapesUsingEncoding:(NSStringEncoding)encoding
on your NSString containing the HTML, like so: