tags:

views:

76

answers:

1

to activate mail application which is in iphone like safari,Maps(built in apps) through iphone SDK? but i have seen in stack overflow like MailComposerViewController in apple samples. they are sending email within iphone application project.but i want to quit project and also to enable built in email application which is in iphone ..?anyhelp? i have done like this..have i to do add any frame works..?

  • (IBAction)ddd:(id)sender { NSString *_recipient = @"[email protected]"; NSURL *_mailURL = [NSURL URLWithString:[NSString stringWithFormat:@"mailto:%@?subject=My Subject", _recipient]]; [[UIApplication sharedApplication] openURL:_mailURL];

}

+1  A: 

No, there are plenty of stackoverflow posts on how to send e-mail without MFMailComposeViewController. In fact, there was at least one response to your request 16 hours earlier that would quit your app and start Mail

Here's how I do it in my apps, copied exactly as it is:

-(IBAction) mailForHelp:(id)sender
{
    NSString *urlStr = [NSString stringWithFormat:@"mailto:[email protected]?subject=NumMemorize Question"];
    NSURL* mailURL = [NSURL URLWithString:[urlStr stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding]];
    [[UIApplication sharedApplication] openURL: mailURL];
}
mahboudz
i did it like NSString *_recipient = @"[email protected]";NSURL *_mailURL = [NSURL URLWithString:[NSString stringWithFormat:@"mailto:%@?subject=My Subject", _recipient]];[[UIApplication sharedApplication] openURL:_mailURL];but it did not give output......i created on button in which i coded above thing...
Mikhail Naimy
This doesn't do anything in the simulator. On the iPhone, it should quit your app and launch Mail.
mahboudz