我一直在尝试使用 MFMailComposer 发送其中包含加密数据的文本文件。问题是当电子邮件到达收件箱时我的附件永远不会显示。相反,一行“<br/><br/>
“总是存在。我假设这与 mime 类型有关,并且接收者邮件服务器不知道如何读取数据,但我只是想不出解决方案。
有人以前遇到过这个问题并有解决方案吗?
if([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];
mailController.mailComposeDelegate =self;
[mailController setSubject:@"Records"];
[mailController setMessageBody:@"" isHTML:YES];
[mailController addAttachmentData:dataToBeEncrypted mimeType:@"text/plain" fileName:@"Records.txt"];
[self presentModalViewController:mailController animated:YES];
[mailController release];
} else {
//Pop up a notification
UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Error" message:@"Could not send email. Verify Internet conneciton and try again." delegate:nil cancelButtonTitle:@"Done" otherButtonTitles:nil];
[alert show];
[alert release];
}
谢谢你提供的所有帮助!
我想我已经解决了。在看到另一个例子后,我只是在黑暗中尝试了一下,它似乎有效。对于 mimetype,我只是输入@“mime”。
我对此有点厌倦,所以我必须做更多测试以确保文件始终正确。
本文内容由网友自发贡献,版权归原作者所有,本站不承担相应法律责任。如您发现有涉嫌抄袭侵权的内容,请联系:hwhale#tublm.com(使用前将#替换为@)