This is my first post to the group so please be kind :)
I am sending a couple of audio attachments from my app as follows:
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
picker.modalPresentationStyle = UIModalPresentationCurrentContext;
[picker setSubject:@"Test message"];
NSArray *toRecipients = [NSArray arrayWithObject:@"foo@bar.com"];
[picker setToRecipients:toRecipients];
// multiple attachments are made as follows
NSData *myData = [NSData dataWithContentsOfFile:filePath];
[picker addAttachmentData:myData mimeType:@"audio/x-caf" fileName:fileName];
[picker setMessageBody:@"test message" isHTML:NO];
[controller presentModalViewController:picker animated:YES];
A mailComposeController method takes care of dismissing the modal view.
Unfortunately, when the message is delivered the mime headers for the attachments land up having the Content-Id set to null. Here is what it looks like:
Content-Type: audio/x-caf; name="audio_1.caf"
Content-Transfer-Encoding: base64
Content-Id: <(null)>
Content-Disposition: attachment; filename="audio_1.caf"
If I manually delete the Content-Id field and reload the message in my Mac Mail program (Mail Version 3.6) the attachments show up correctly. In other words, I don't really need/want theContent-Id to be inserted in the mime header.
Also, its worth mentioning that for debugging purposes if I set the mime type to "image/jpeg" the mime header does get a valid Content-Id string. All my attachments show up in Mail. As is to be expected, in that case the attachments don't open correctly on the Mac or iPhone.
Any help would be greatly appreciated.
thanks, apurva