我已經使用MFMailComposeViewController發送生成的報告(csv)。無法通過郵件發送csv文件附件
現在郵件被髮送到:電子郵件ID,&但是當我檢查郵件我收到了郵件但附件不在那裏。
然後我還試圖MailComposer例如:
https://developer.apple.com/iphone/library/samplecode/MailComposer/index.html
其中PNG圖像被附加到演示郵件。我還使用該應用程序發送郵件,但未傳送相同的結果圖像附件。
幫忙,找出有什麼問題? 在此先感謝。
這裏是該應用代碼:
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@"Hello from California!"];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@"[email protected]"];
NSArray *ccRecipients = [NSArray arrayWithObjects:@"[email protected]", @"[email protected]", nil];
NSArray *bccRecipients = [NSArray arrayWithObject:@"[email protected]"];
[picker setToRecipients:toRecipients];
[picker setCcRecipients:ccRecipients];
[picker setBccRecipients:bccRecipients];
// Attach an image to the email
NSString *path = [[NSBundle mainBundle] pathForResource:@"rainy" ofType:@"png"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"rainy"];
// Fill out the email body text
NSString *emailBody = @"It is raining in sunny California!";
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
謝謝兄弟... 我檢查了mydata,它不是零.. !!!! 但我仍無法找到附件。 – Nic 2009-11-21 10:38:38