是否可以使用邮件 API 在电子邮件附件中发送 zip 存档文件?
最佳答案
试试这个..这个对我有用
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init]; picker.mailComposeDelegate = self; NSArray *paths = NSSearchPathForDirectoriesInDomains(NSDocumentDirectory, NSUserDomainMask, YES);
NSString *documentsDirectory = [paths objectAtIndex:0];
NSString *WritableDBPath= [documentsDirectory stringByAppendingPathComponent:kFilename];
NSData *data = [NSData dataWithContentsOfFile:WritableDBPath];
[picker addAttachmentData:data mimeType:@"application/zip" fileName:@"/abc.zip"];
[picker setSubject:@"Database"];
[picker setMessageBody:@"Database testing" isHTML:NO];
[self presentModalViewController:picker animated:YES];
关于iphone - 在 iPhone 邮件附件中使用 ZipArchive Zip 文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3687235/