当我有多个收件人时,我面临一个问题,默认情况下,我在其中有两个附件。当我向多个收件人发送邮件时,除了以下代码外,我有什么需要做的; (我必须从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开发的入门者,所以我需要您的宝贵帮助。

最佳答案

尝试这个

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
NSArray *toRecipients = [NSArray arrayWithObjects:@"[email protected]",@"[email protected]",nil];
[picker setToRecipients:toRecipients];

关于ios - 我的应用程序邮件有多个收件人时出现问题- objective-c ,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15540093/

10-13 03:50