I'm trying to send mail to list of email array that I receive from database, when I send the recipient list gets populated in iOS 7
but when I tried in iOS 5
the recipient list doesn't get populated. Any Idea why? This is my mail function
-(void)sendEmailToContacts:(NSArray *)fList withText:(NSString *)emailText withTag:(NSInteger )tag
{
if([MFMailComposeViewController canSendMail])
{
MFMailComposeViewController *mailComposer = [[MFMailComposeViewController alloc] init];
mailComposer.view.tag=tag;
NSString *htmlBody =[NSString stringWithFormat:@"<a href=\"%@\">%@</a>",_currentAdd.contentUrl,addtext];
[mailComposer setMessageBody:htmlBody isHTML:YES];
[mailComposer setSubject:_currentMail.subject];
mailComposer.mailComposeDelegate = self;
[mailComposer setToRecipients:fList];
[self presentViewController:mailComposer animated:YES completion:nil];
}
else
{
NSLog(@"Device is unable to send email in its current state.");
}
}
My fList
(recipient list) is an NSArray
, this is a sample output of my fList
(
"john@gmail.com",
"mary@gmail.com",
"akhil@gmail.com",
"tester@gmail.com"
)