gpt4 book ai didi

iPhone 邮件应用程序

转载 作者:行者123 更新时间:2023-11-29 04:56:59 25 4
gpt4 key购买 nike

是否可以打开 Iphone Mail 应用程序而无需撰写新邮件?

[[UIApplication sharedApplication] openURL:[NSURL URLWithString:[NSString stringWithFormat:@"mailto:%@?subject=My Subject", _recipient]]];

此代码不适合我。

我只需在主屏幕上打开邮件应用程序。

谢谢

P.S 抱歉我的英语))

最佳答案

   -(void) EmailMethod
{
MFMailComposeViewController *picker=[[MFMailComposeViewController alloc]init];
picker.mailComposeDelegate = self;
[picker setToRecipients:@"mailid@mymail.com"];
[picker setSubject:@"Place your subject of mail here."];
[picker setMessageBody:@"Place your body of mail here." isHTML:YES];
[self presentModalViewController:picker animated:YES];
}

- (void)mailComposeController:(MFMailComposeViewController*)controller
didFinishWithResult:(MFMailComposeResult)result error:(NSError*)error
{
switch (result)
{
case MFMailComposeResultCancelled:
UIAlertView *ErrorAlert = [[UIAlertView alloc] initWithTitle:@"Canceled !!"
message:@"Mail sending cancelled." delegate:nil
cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[ErrorAlert show];
[ErrorAlert release];
break;
case MFMailComposeResultSaved:
UIAlertView *ErrorAlert = [[UIAlertView alloc] initWithTitle:@"Saved"
message:@"Mail saved to Drafts." delegate:nil
cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[ErrorAlert show];
[ErrorAlert release];
break;
case MFMailComposeResultSent:
UIAlertView *ErrorAlert = [[UIAlertView alloc] initWithTitle:@"Email Sent"
message:@"Thank you for recommending us to your friends via Email."
delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[ErrorAlert show];
[ErrorAlert release];
break;
case MFMailComposeResultFailed:
UIAlertView *ErrorAlert = [[UIAlertView alloc] initWithTitle:@"Error !!"
message:@"Failed to send mail." delegate:nil
cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[ErrorAlert show];
[ErrorAlert release];
break;
default:
UIAlertView *ErrorAlert = [[UIAlertView alloc] initWithTitle:@"Error !!"
message:@"Failed to send mail." delegate:nil
cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[ErrorAlert show];
[ErrorAlert release];
break;
}
[self becomeFirstResponder];
[self dismissModalViewControllerAnimated:YES];

关于iPhone 邮件应用程序,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/7766669/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com