我已经使用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