0

In my app, if the user has not configured their E-mail account on their iPhone, then when the user opens the application, it will ask for e-mail configuration (means the app redirects to "settings >> mail >> add account " add account page),

How can I do that?

I searched and found one similar question in stack overflow but it was not helpful. just like this so question

Community
  • 1
  • 1
Muhammad Rizwan
  • 3,470
  • 1
  • 27
  • 35
  • possible duplicate of [How do i show the mail setup page programatically in iphone?](http://stackoverflow.com/questions/6015855/how-do-i-show-the-mail-setup-page-programatically-in-iphone) – Jim Jul 14 '11 at 07:17

1 Answers1

0

just see the official sample code.Here is the link:SampleCode

find the launchMailAppOnDevice() function.

// Launches the Mail application on the device.
-(void)launchMailAppOnDevice
{
    NSString *recipients = @"mailto:first@example.com?cc=second@example.com,third@example.com&subject=Hello from California!";
    NSString *body = @"&body=It is raining in sunny California!";

    NSString *email = [NSString stringWithFormat:@"%@%@", recipients, body];
    email = [email stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding];

    [[UIApplication sharedApplication] openURL:[NSURL URLWithString:email]];
}

It was useful for me. Hope it can help you.

Bonny
  • 2,038
  • 1
  • 14
  • 15