I want to send multiple attachment files in single mail in iOS programatically. I have tried the following so far:
// I give the file from array
NSString *str_mail = [readingEmfReading objectAtIndex:0];
// here I can encode the file
NSData *myData = [str_mail dataUsingEncoding:NSUTF8StringEncoding]
//here I can attach the file with extance of .csv
[controller addAttachmentData:myData mimeType:@".cvs" fileName:retriveEmail]
//here I can set the body for mail
[controller setMessageBody:@"file" isHTML:NO];
//here code for sent mail
if (controller) [self presentViewController:controller animated:YES completion:nil];
By using this code, I can only send one attachment. I want to send multiple files however. How can I achieve this?
–addAttachmentData:mimeType:fileName:any times you'd like to add an attachment, it is an kind of add not a kind of set method (see the prefix)... the difference is obvious, but the documentation could also help, if you are unsure.