gpt4 book ai didi

iphone - 使用 iPhone SDK 中的 MFMailComposer 附加纯文本文件

转载 作者:行者123 更新时间:2023-12-03 21:22:42 26 4
gpt4 key购买 nike

我一直在尝试使用 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”。

我对此有点厌倦,因此我必须进行更多测试以确保文件始终正确。

关于iphone - 使用 iPhone SDK 中的 MFMailComposer 附加纯文本文件,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3295886/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com