0

In my application i am using MFMailComposer to send email.

In my application user can select a time when he want to send and email.

It's working fine. but what i have done is, i have used NSTimer to open the MFMailComposeViewController and i have programmatically click the send button.

But i am not sure ,that apple might approve my app or reject. Has anybody have use this type function in there app and apple has approved or rejected there app.Please let know that.

please help me out.

following is my code:

-(void)showController {
    MFMailComposeViewController *mailController;
    //alloc, init, set properties, do whatever you normally would
    [self.navigationController presentModalViewController:mailController animated:YES];
    [mailController release];

    [NSTimer scheduledTimerWithTimeInterval:3 target:self selector:@selector(sendMail:) userInfo:mailController repeats:NO];
}

-(void)sendMail:(NSTimer*)theTimer {
    MFMailComposeViewController *mailController = theTimer.userInfo;
    UIBarButtonItem *sendBtn = mailController.navigationBar.topItem.rightBarButtonItem;
    id targ = sendBtn.target;
    [targ performSelector:sendBtn.action withObject:sendBtn];
}
Nilesh .S. Joshi
  • 567
  • 2
  • 9
  • 26
  • This isn't expected behavior of `MFMailComposeViewController`. I wouldn't recommend doing such a thing, Apple may very well reject your app for utilizing this method of Auto-Email. – skram Jun 11 '12 at 08:15
  • May I recommend looking into some background email sending code, like the accepted answer here: http://stackoverflow.com/questions/6284599/mfmailcomposeviewcontroller-question-locking-the-fields – Luke Jun 11 '12 at 08:20

1 Answers1

0

You need to confirmation from user. and user will click on send button. You can only create mail and display to user for confirmation. Its default behavior of MFMailComposeViewController.

Thanks

Mitesh Khatri
  • 3,935
  • 4
  • 44
  • 67