Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- - (IBAction) sendEmails:(id)sender{
- Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
- if (mailClass != nil)
- {
- // We must always check whether the current device is configured for sending emails
- if ([mailClass canSendMail])
- {
- MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
- picker.mailComposeDelegate = self;
- NSMutableArray *to = [[NSMutableArray alloc] initWithCapacity:0];
- for(NSDictionary *d in selectedEmails)
- {
- [to addObject:[d objectForKey:@"email"]];
- }
- [picker setBccRecipients:to];
- [picker setSubject:@"Let's catchup via ..."];
- // Fill out the email body text
- NSString *emailBody = @"adasda";
- [picker setMessageBody:emailBody isHTML:YES];
- [self presentModalViewController:picker animated:YES];
- [picker release];
- }
- else
- {
- //[self launchMailAppOnDevice];
- }
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement