Hänge ein Foto von meiner iPhone-Anwendung an eine E-Mail an
Ich habe eine iPhone-Anwendung, die Fotos aus dem in der App integrierten Fotoalbum auswählt. Jetzt möchte ich eine Freigabeschaltfläche mit der Option zum Freigeben dieses Fotos per E-Mail hinzufügen. Ich kann ein vorhandenes Foto über diesen Code anhängen:
MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
picker.mailComposeDelegate = self;
[picker setSubject:@""];
// Set up recipients
NSArray *toRecipients = [NSArray arrayWithObject:@""];
[picker setToRecipients:toRecipients];
// Attach an image to the email
NSString *path = [[NSBundle mainBundle] pathForResource:@"project existing photo" ofType:@"jpg"];
NSData *myData = [NSData dataWithContentsOfFile:path];
[picker addAttachmentData:myData mimeType:@"image/jpeg" fileName:@"photo name"];
// Fill out the email body text
NSString *emailBody = @"";
[picker setMessageBody:emailBody isHTML:NO];
[self presentModalViewController:picker animated:YES];
[picker release];
Aber was muss ich in diesem Code ändern, um das ausgewählte Fotoalbum in den E-Mail-Text anzuhängen? Danke im Voraus.