Parth Bhatt
Parth Bhatt

Reputation: 19469

iPhone: Using MFMailComposeViewController API image problems

I am using MFMailComposeViewController API in iPhone app to send images via Email.

It displays correctly on iPhone but fails to show the image in Computer.

When we click that image on computer it shows "no preview available".

We are using PNG images.

What could be wrong?

Code:

  NSData *myData = [[NSData alloc] initWithContentsOfFile:FilePath]

  [emailAPIObject addAttachmentData:myData mimeType:@"image/png" fileName:@"Image"];

Upvotes: 0

Views: 791

Answers (1)

Gurnetko
Gurnetko

Reputation: 76

I got this code working with small changes:

NSData *myData = [NSData dataContentsOfFile:FilePath];   
[emailAPIObject addAttachmentData:myData mimeType:@"png" fileName:@"Image.png"];

Upvotes: 1

Related Questions