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];
}
its working fine in ios5 but not working in ios6 m testing on device