Advertisement
Guest User

Untitled

a guest
Jul 22nd, 2017
64
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. - (IBAction) sendEmails:(id)sender{
  2.     Class mailClass = (NSClassFromString(@"MFMailComposeViewController"));
  3.     if (mailClass != nil)
  4.     {
  5.             // We must always check whether the current device is configured for sending emails
  6.         if ([mailClass canSendMail])
  7.         {
  8.             MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
  9.             picker.mailComposeDelegate = self;
  10.            
  11.             NSMutableArray *to = [[NSMutableArray alloc] initWithCapacity:0];
  12.             for(NSDictionary *d in selectedEmails)
  13.             {
  14.                 [to addObject:[d objectForKey:@"email"]];
  15.             }
  16.             [picker setBccRecipients:to];
  17.             [picker setSubject:@"Let's catchup via ..."];
  18.            
  19.                 // Fill out the email body text
  20.             NSString *emailBody = @"adasda";
  21.             [picker setMessageBody:emailBody isHTML:YES];
  22.            
  23.             [self presentModalViewController:picker animated:YES];
  24.             [picker release];
  25.         }
  26.         else
  27.         {
  28.                 //[self launchMailAppOnDevice];
  29.         }
  30.     }
  31. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement