我MFMailComposeViewController
用来发送文件。15mb 以下的文件一切正常。一切都结束了,文件根本不会附加到MFMailComposeViewController
视图中。并不是电子邮件服务器不接受,而是它从一开始就没有附加。
如果有办法解决这个问题,有人有什么想法吗?
我知道许多电子邮件服务无法处理超过 5 或 10mb 的附件,但其他服务允许您使用更大的文件大小。
MFMailComposeViewController *mail = [[[MFMailComposeViewController alloc] init] autorelease]; mail.mailComposeDelegate = self; NSString* path = [NSString stringWithFormat:@"%@/%@/%@", NSHomeDirectory(), @"Documents", fileName]; NSData *data = [NSData dataWithContentsOfMappedFile:path]; //也尝试了具有相同结果的dataWithContentsOfFile [mail addAttachmentData:data mimeType:@"audio/x-caf" fileName:[NSString stringWithFormat:@"%@.caf", label]]; [appDelegate.tabBarController presentModalViewController:邮件动画:YES];