iphone - How to attach multiple files in single mail in iOS -


i want send multiple attachment files in single mail in ios programatically. have tried following far:

 // give file array  nsstring *str_mail = [readingemfreading objectatindex:0]; //  here can encode file nsdata *mydata = [str_mail datausingencoding:nsutf8stringencoding] //here can attach file extance of .csv [controller addattachmentdata:mydata mimetype:@".cvs" filename:retriveemail]   //here can set body mail  [controller setmessagebody:@"file" ishtml:no]; //here code sent mail if (controller) [self presentviewcontroller:controller animated:yes completion:nil]; 

by using code, can send 1 attachment. want send multiple files however. how can achieve this?

you add many time addattachmentdata , add muliple file

try code :- add line

nsstring *str_mail = [readingemfreading objectatindex:0]; //  here can encoded file nsdata *mydata = [str_mail datausingencoding:nsutf8stringencoding]  nsdata *mydata1 = [str_mail datausingencoding:nsutf8stringencoding] //here can attach file extance of .csv [controller addattachmentdata:mydata mimetype:@".cvs" filename:retriveemail]   //here can set body mail    // second file   nsdata *mydata1 = [str_mail datausingencoding:nsutf8stringencoding]  [controller addattachmentdata:mydata1 mimetype:@".cvs" filename:retriveemail]   [controller setmessagebody:@"file" ishtml:no]; //here code sent mail if (controller) [self presentviewcontroller:controller animated:yes completion:nil]; 

Comments

Popular posts from this blog

linux - xterm copying to CLIPBOARD using copy-selection causes automatic updating of CLIPBOARD upon mouse selection -

c++ - qgraphicsview horizontal scrolling always has a vertical delta -