Advertise here

Advertise here

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

MFMailComposeViewController: image attachment

XavierXavier Posts: 38Registered Users
edited September 2009 in iPhone SDK Development

I'm trying to send an email with an image attached, using MFMailComposeViewController.
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];

NSString *path = [[NSBundle mainBundle] pathForResource:@"Icon" ofType:@"png"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"image/png" fileName:@"Icon.png"];
NSString *emailBody = @"Test";
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];

The image is correctly displayed when I send the email, but when I receive it the image cannot be displayed because it contains some errors.

WHat am I missing ?
Post edited by Xavier on


Sign In or Register to comment.