2
我一直在尝试使用MFMailComposer来发送带有加密数据的文本文件。问题是,当电子邮件到达收件箱时,我的附件永远不会显示出来。相反,一行“<br/><br/>
”始终存在。我假设是有关的MIME类型和接收邮件服务器不知道如何读取数据,但我无法找出解决方案。在iPhone SDK中使用MFMailComposer附加纯文本文件
任何人都遇到过这个,并有一个解决方案?
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];
}
感谢您给予的任何帮助!