I am using the following code to send an email with the contents of NSData object(with the variable name: data):
MFMailComposeViewController *controller = [[MFMailComposeViewController alloc] init];
[controller setSubject:@"Subject"];
[controller addAttachmentData:data mimeType:@"application/pdf" fileName:@"Attachment"];
[controller setMessageBody:@"Please find attached the connections for..." isHTML:NO];
controller.mailComposeDelegate = self;
[self presentModalViewController:controller animated:YES];
It adds a UIView generated as a pdf as an attachment and sends the email. It is all good, besides a single problem:
When the email is received, along with the attached pdf, there is another attached .txt file whose contents are: "Sent from my iPad" . If I do not attach the pdf, the "Sent from my iPad" message appears in the body of the email, instead in an attached file.
Does anyone have a clue how this can be resolved ? I do not want the text file to be attached in the message.
Regards,
Petar