Search code examples
iphoneobjective-ciosios4

How to open iphone mail application from my own application?


i am working on signup feature. In this feature when the user create account successfully. i am asking him or her to activate his account. i want to open the mail application of iphone if user say yes. now my question is simple how to open mail application from my own application?


Solution

  • #define URLEMail @"mailto:sb@sw.com?subject=title&body=content"
    
     NSString *url = [URLEMail stringByAddingPercentEscapesUsingEncoding:NSUTF8StringEncoding ]; 
     [[UIApplication sharedApplication]  openURL: [NSURL URLWithString: url]];