if ([MFMailComposeViewController canSendMail]) {
MFMailComposeViewController * mailComposeController=[[MFMailComposeViewController alloc]init];
mailComposeController.mailComposeDelegate = self;
// mailComposeController.wantsFullScreenLayout = NO;
[mailComposeController setSubject:@"WallPaperApp."];
[mailComposeController setMessageBody:@"This is my new Wallpaper." isHTML:NO];
UIImage *img=mainImageView.image;
UIImage *img1=[UIImage imageNamed:@"aaa.jpg"];
NSData *imageData = UIImagePNGRepresentation(img);
[mailComposeController addAttachmentData:imageData mimeType:@"image/jpg" fileName:[NSString stringWithFormat:@"photo.png"]];
[self presentModalViewController:mailComposeController animated:YES];
//[mailComposeController release];
}
它在 ios5 中工作正常,但在设备上的 ios6 m 测试中不工作