gpt4 book ai didi

iphone - 如何显示电子邮件已发送通知 ipad

转载 作者:行者123 更新时间:2023-11-28 22:53:00 27 4
gpt4 key购买 nike

我有一个成功发送电子邮件的邮件 Controller 。

但是我想在发送电子邮件时显示“电子邮件发送成功”的通知。有办法吗?

谢谢。

最佳答案

如果您正在使用 MFMailComposeViewController,您可以使用它的委托(delegate)方法。

1. 设置委托(delegate):mailController.mailComposeDelegate=self;

2. 然后使用委托(delegate)方法`

 - (void)mailComposeController:(MFMailComposeViewController *)controller didFinishWithResult:(MFMailComposeResult)result error:(NSError *)error
{
if(result == MFMailComposeResultSent)
{
UIAlertView*sentalert=[[UIAlertView alloc] initWithTitle:@"Mail Sent succesfully!" message:nil delegate:nil cancelButtonTitle:@"OK" otherButtonTitles:nil, nil];
[sentalert show];
[sentalert release]; // if not using ARC
}

[self dismissModalViewControllerAnimated:YES]; //Dismiss your mail controller
}

关于iphone - 如何显示电子邮件已发送通知 ipad,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11469522/

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