0

I am new to iOS programming and Xcode, so i'll apologise in advanced.

i have written a small Application where the user completes a number of text boxes. upon completing the text boxes i have created a submit button. At which point all the data is written to a .csv file within the sandbox.

What i am trying to do from this point, on a second screen is create a button that takes the csv file and attaches it to an email enabling the user to send it on.

Does anybody a know of way of being able to attach a text file or csv file from the sandbox to an email? The only thing I can find is, the suggestion that I have to rewrite the data out of the .csv file into another file in order to email the data.

Thanks in advanced. Lee.

Lee.712
  • 1
  • 1
  • 1

2 Answers2

0

try addAttachmentData property of MFMailComposer , if you are using in app email.

you can check this also - Attaching plain text file using MFMailComposer in iPhone SDK

Community
  • 1
  • 1
Naina Soni
  • 720
  • 5
  • 21
0
 MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
 [picker addAttachmentData:imageData mimeType:@"text/csv"  fileName:csvName];
Yogev Shelly
  • 1,373
  • 2
  • 13
  • 24