views:

23

answers:

0

I'm trying to send an NSString as an attachment using MFMailComposeViewController.

When I open the Mail I just have a "Part 1.2" Attachment.

Here's the code used:

MFMailComposeViewController* controller = [[MFMailComposeViewController alloc] init];
NSMutableString* writtenWillItBe=[NSMutableString stringWithFormat:@"...",...];
[controller addAttachmentData:[writtenWillItBe dataUsingEncoding:NSASCIIStringEncoding]
mimeType:@"text/plain" fileName:@"test.txt"];