我一直在尝试使用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];
}
感谢您提供任何帮助!
答案 0 :(得分:1)