Attach multiple image in mail in iPhone

前端 未结 1 840
清歌不尽
清歌不尽 2021-01-16 03:23

I want attach multiple images in mail programmatically. Is there any way possible to attach the photos as zip and attach it to mail.

Is there another way to send tex

相关标签:
1条回答
  • 2021-01-16 03:46

    You need to call -addAttachmentData:mimeType:fileName: multiple times.

    I've used below code to attach multiple images :-

    mailViewController = [[MFMailComposeViewController alloc] init];
    mailViewController.mailComposeDelegate = self;
    [mailViewController setSubject:yourSubject];
    [mailViewController setMessageBody:yourBodyMsg isHTML:NO];
    [mailViewController addAttachmentData:emailAttachment1 mimeType:@"image/jpeg" fileName:@"abc.jpg"];
    [mailViewController addAttachmentData:emailAttachment2 mimeType:@"image/jpeg" fileName:@"xyz.jpg"];
    
    0 讨论(0)
提交回复
热议问题