【发布时间】:2009-09-23 11:30:53
【问题描述】:
我想使用 MFMailComposeViewController 通过电子邮件发送文本大纲。我目前正在通过创建文档的 HTML 版本并将其设置为邮件正文来执行此操作。这在 MFMailComposeViewController 中查看电子邮件时效果很好,但在接收端(MobileMail.app、GMail Webinterface、OSX Mail。 app) 格式丢失。
这是我当前的代码:
- (IBAction)showMailController {
if (![MFMailComposeViewController canSendMail]) return;
MFMailComposeViewController *mailComposeViewController = [[MFMailComposeViewController alloc] init];
mailComposeViewController.mailComposeDelegate = self;
NSString *stringRepresentation = @"<html><head></head><body><ul><li>@grocery</li><ul><li>Milk</li><li>Cat food</li><li>Rice</li><li>Tofu</li></ul></ul></body></html>";
[mailComposeViewController setMessageBody:stringRepresentation isHTML:YES];
[self presentModalViewController:mailComposeViewController animated:YES];
[mailComposeViewController release];
}
我做错了吗?还有其他方法吗?
我还尝试通过手动缩进导出为简单的文本大纲(我插入了两个空格,因为制表符不起作用),但文本编辑器无法将其识别为大纲。
NSMutableString *inset = [[NSMutableString alloc] init];
NSUInteger i;
for (i=0; i<insetCount;i++) {
[inset appendString:@" "];
}
NSMutableString *string = [[NSMutableString alloc] initWithString: [NSString stringWithFormat:@"%@%C ", inset, 0x2022]];
感谢您的帮助!
【问题讨论】:
-
跟进:发布此问题后不久,打开了一个仍然打开的雷达:radar://7242405,我现在将大纲作为文本附件附加到电子邮件中。
标签: iphone ios email iphone-sdk-3.0 mfmailcomposeviewcontroller