当我的邮件有多个收件人时,我遇到了一个问题,默认情况下我有两个附件。当我向多个收件人发送邮件时,除了下面的代码之外,我还有什么需要做的吗?(我必须从 UI 中选择或输入收件人 ID)
if ([MFMailComposeViewController canSendMail])
{
[self printPdfAndCsv];// code to generate pdf & csv
MFMailComposeViewController* mailComposer = [[MFMailComposeViewController alloc] init];
mailComposer.mailComposeDelegate = self;
// attaching PDF File.
[mailComposer addAttachmentData:[NSData dataWithContentsOfFile:self.pdfFilePath]
mimeType:@"Application/pdf" fileName:[NSString stringWithFormat:@"pdfName-%@.pdf", selectedProjectName ]];
// attaching CSV File.
[mailComposer addAttachmentData:[NSData dataWithContentsOfFile:self.csvFilePath]
mimeType:@"text/csv" fileName:[NSString stringWithFormat:@"csvName-%@.csv", selectedProjectName ]];
[self presentViewController:mailComposer animated:YES completion:nil];
}
我是 iPhone 开发的初学者,所以我需要您的宝贵帮助。