2012-07-13 124 views
0

我有一個成功發送電子郵件的郵件控制器。如何顯示電子郵件發送通知ipad

但是我想在郵件發送時顯示「發送成功的電子郵件」通知。有沒有辦法做到這一點?

謝謝。

+0

什麼mailcontroller您使用的? – 2012-07-13 11:27:08

回答

2

如果您使用MFMailComposeViewController,則可以使用其委託方法。

設置委託:mailController.mailComposeDelegate=self;

2.然後使用委託方法`

- (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 
} 
+0

記得發佈你的提醒;) – 2012-07-13 12:09:26

+0

@Cupcake,也習慣於'ARC':D,你會把它加起來。 – iNoob 2012-07-13 12:11:02

+1

只是感謝所有Stack Overflow成員。這是最好的網站,你是最好的! – SHA 2012-07-16 06:08:59

相關問題