我一直在尝试使用 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];
}
谢谢你提供的所有帮助!