0

メールを正常に送信するメールコントローラーがあります。

しかし、メールが送信されたときに「メールが正常に送信されました」という通知を表示したい。それを行う方法はありますか?

ありがとう。

4

1 に答える 1

2

を使用している場合はMFMailComposeViewController、そのデリゲート メソッドを使用できます。

1.デリゲートを設定します。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
}
于 2012-07-13T11:35:49.230 に答える