0

メールの複数の受信者がデフォルトで 2 つの添付ファイルを持っている場合に問題に直面しています。以下のコード以外の複数の受信者にメールを送信するときに何かしなければならないことはありますか? (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 開発のスターターなので、あなたの貴重な助けが必要です。

4

3 に答える 3

1

複数のユーザーにメールを送信する場合は、次を使用できます。

[mailController setToRecipients:[NSArray arrayWithObject:@"email@address.com",@"email1@address.com",@"email@address.com",nil]];
于 2013-03-21T05:23:27.997 に答える
1

これを試して

MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
NSArray *toRecipients = [NSArray arrayWithObjects:@"abc@gmail.com",@"xyz@gmail.com",nil]; 
[picker setToRecipients:toRecipients];
于 2013-03-21T05:27:41.640 に答える
0

I got a solution from rmaddy on his comment,

  • There may be problem with one of the email addresses we tested.

  • Maybe the email ended up appearing as junk mail (spam).

    Once the user taps Send, it's out of our control. (and in my case; i found the mails that i have sent were in spam box)

于 2013-03-21T08:38:27.163 に答える