我正在尝试将邮件发送到我从数据库接收的电子邮件数组列表,当我发送收件人列表时会被填充,iOS 7
但当我尝试在iOS 5
收件人列表中时不会被填充。任何想法为什么?这是我的邮件功能
-(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.");
}
}
我的fList
(收件人列表)是一个NSArray
,这是我的 fList 的示例输出
(
"john@gmail.com",
"mary@gmail.com",
"akhil@gmail.com",
"tester@gmail.com"
)