Tuesday, July 29, 2014

How to open email program within iPhone app

Sometimes within an iPhone application, it might be necessary to open the phone's default email client.

In order to do this, all you need are just a few lines of code.

First, create your method in the header file.

-(IBACTION)openEmail;

Next, build it out in the implementation file.

-(IBACTION)openEmail {

[[UIApplication sharedApplication]openURL;[NSURL URLWithString:@"mailto:test@test.com"]];


}

That's it.

Check out my car app for iPhone in the iTunes App Store

No comments:

Post a Comment