Search code examples
iosios5mfmailcomposeviewcontroller

issue when multiple recipients for my app mail- Objective c


I am facing a problem when multiple recipients for my mail, i have two attachments there by default.Is there anything i have to do when iam sending a mail to multiple recipients other than the below code; (I have to select or type recipient id's from UI)

    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];
           }

Iam a starter in iPhone development, so i need your valuable help.


Solution

  • 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)