【发布时间】:2023-03-16 19:06:01
【问题描述】:
大家好
我们可以使用“MFMailComposeViewController”而不使用“presentModalViewController”吗,我的意思是我需要发送电子邮件而不导航到该邮件撰写器页面
我用以下代码做了一个测试项目
- (IBAction)buttonPressed {
arrRecipients = [[NSMutableArray alloc]init];
[arrRecipients addObject:@"xxxxxxx@gmail.com"];
MFMailComposeViewController *mailController = [[MFMailComposeViewController alloc] init];
mailController.mailComposeDelegate = self;
[mailController setSubject:@"Ravikiran test mail"];
[mailController setToRecipients:arrRecipients];
[mailController setMessageBody:@"this is my test app" isHTML:YES];
[self presentModalViewController:mailController animated:YES];
[mailController release];
}
它正在发送邮件,但它正在导航到邮件编写器页面,然后它正在发送,但我只需单击按钮即可发送邮件
【问题讨论】:
标签: iphone objective-c email sendmail