1
我正在使用MFMailComposeViewController
發送文件。一切工作正常15MB以下的文件。任何結束,該文件根本不會附加到MFMailComposeViewController
視圖。這並不是說電子郵件服務器不接受,而是它永遠不會被附加在首位。MFMailComposeViewController附件文件大小限制
有沒有人有任何想法,如果有辦法解決這個問題?
我知道很多電子郵件服務無法處理附件超過5或10MB,但其他服務讓您更大的文件大小。
MFMailComposeViewController *mail = [[[MFMailComposeViewController alloc] init] autorelease]; mail.mailComposeDelegate = self; NSString* path = [NSString stringWithFormat:@"%@/%@/%@", NSHomeDirectory(), @"Documents", fileName]; NSData *data = [NSData dataWithContentsOfMappedFile:path]; //also tried dataWithContentsOfFile with same results [mail addAttachmentData:data mimeType:@"audio/x-caf" fileName:[NSString stringWithFormat:@"%@.caf", label]]; [appDelegate.tabBarController presentModalViewController:mail animated:YES];
不應該使用dataWithContentsOfMappedFile的要點是電子郵件可以在沒有實際將整個文件一次讀入內存的情況下發送嗎? – 2009-11-25 06:49:54
這是否可行還取決於系統的郵件假脫機程序是否也能夠並且願意從磁盤脫機;我的猜測是它在RAM中構建了整個MIME消息。 – 2010-04-03 05:21:36