title: adding IBAction to send an email from my app
body: <p>I have a contact us page in my app which shows my Facebook, twitter and website pages. I have managed to get them to work properly by linking a IBAction to the button. The code i used below, however i would like to do the same with my email. When the button is pressed i want to open up the email on the phone and the "To" "subject" fields to be already filled in. I don't want to add a email form to my app as that is the only thing I can find info on.
  Is there a way i can achieve this? </p>
  
  <pre><code>      import UIKit
         import MessageUI
  
          class SocialViewController: UIViewController {
  
  override func viewDidLoad() {
      super.viewDidLoad()
  
      // Do any additional setup after loading the view.
  }
  
  override func didReceiveMemoryWarning() {
      super.didReceiveMemoryWarning()
      // Dispose of any resources that can be recreated.
  }
  
  
  
       @IBAction func openWeb(sender: AnyObject) {
  UIApplication.sharedApplication().openURL(NSURL(string: "http://www.xxxxxxxxxxxx.com")!)
     }
  
  
  
     @IBAction func openFB(sender: AnyObject) {
  
  if UIApplication.sharedApplication().canOpenURL(NSURL(string: "fb://profile/XXXXXXXX")!) {
    UIApplication.sharedApplication().openURL(NSURL(string: "fb://profile/XXXXXXXXXX")!)
  } else {
    UIApplication.sharedApplication().openURL(NSURL(string: "https://facebook.com/XXXXXXXXX")!)
  }
    }
  
  
  
    @IBAction func openTW(sender: AnyObject) {
  
  if UIApplication.sharedApplication().canOpenURL(NSURL(string: "tw://profile/XXXXXXXXX")!) {
    UIApplication.sharedApplication().openURL(NSURL(string: "fb://profile/XXXXXXX")!)
  } else {
    UIApplication.sharedApplication().openURL(NSURL(string: "https://twitter.com/XXXXXXX")!)
  }
    }
  
  
  
      }
  </code></pre>