我使用此代码来通过单击按钮发送电子邮件: -(IBAction)btn_emailClick:(id)sender{ // checking for the blank Email id field. if ([[patientDemogDic valueForKey:@"email"] isEqualToString:@""]){ } else{ if([MFMailComposeViewController canSendMail]){ MFMailComposeViewController * mailer = [[MFMailComposeViewController alloc] init]; mailer.mailComposeDelegate = self; [mailer setSubject:@""]; NSArray * toRecipients = [NSArray arrayWithObjects:[btn_emailClick currentTitle], nil]; [mailer setToRecipients:toRecipients]; NSString *emailBody = @""; [mailer setMessageBody:emailBody isHTML:NO]; mailer.navigationBar.barStyle = UIBarStyleBlackOpaque; [self presentViewController:mailer animated:YES completion:Nil]; } else{ UIAlertView *alert = [[UIAlertView alloc] initWithTitle:@"Failure" message:@"Your device doesn't support the composer sheet" delegate:self cancelButtonTitle:@"OK"otherButtonTitles:nil]; [alert show]; } } }一切工作都很好,但是一旦电子邮件地址是这个: nupur_Pal.iwalMeditab,。 {} []!#$%^&* _ @ meditab.com 电子邮件编辑器屏幕中的“收件人”字段未显示此电子邮件地址。我已经调试了好几次,但是找不到合适的原因。 (adsbygoogle = window.adsbygoogle || []).push({}); 最佳答案 制作IBOutlet电子邮件UIButton并尝试以下代码 NSArray * toRecipients = [NSArray arrayWithObjects:emailButton.titleLabel.text, nil]; [mailer setToRecipients:toRecipients];关于iphone - 在iOS的邮件撰写器中设置“收件人”字段时出现问题,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/16437483/ (adsbygoogle = window.adsbygoogle || []).push({});
10-10 06:33