title: Send email from iOS app with html body and image tag
body: <p>I know this question has been asked before, but I haven't seen anything recent so am hoping for a fix. 
  Currently I am sending an email with an html body that contains two image tags. Originally I was just doing something like </p>
  
  <p><code>&lt;img width="100" src="http://cdn1-www.dogtime.com/assets/uploads/gallery/30-impossibly-cute-puppies/impossibly-cute-puppy-2.jpg" &gt;</code> </p>
  
  <p>but now am just trying to use a local image and use base64 encoding, so something like </p>
  
  <p><code>&lt;img width="100" src="data:image/png;base64,...&gt;</code></p>
  
  <p>So far I've had success with that from within iOSs mail but once I open it in Gmail or Outlook or anything else it isn't working. </p>
  
  <p>Has any one found a solution to this? </p>
  
  <p>My code... </p>
  
  <pre><code>let mailComposer = MFMailComposeViewController()
  mailComposer.mailComposeDelegate = self
  mailComposer.setToRecipients([String]())
  mailComposer.setSubject("email with image in body")
  mailComposer.setMessageBody(getHtmlBody(), isHTML: true)
  self.presentViewController(mailComposer, animated : true, completion: nil)
  
  getHtmlBody(){
      let imgData:NSData = UIImagePNGRepresentation(UIImage(named : "logo")!)
      let dataString = imgData.base64EncodedStringWithOptions(NSDataBase64EncodingOptions(rawValue: 0))
  
      var html = "&lt;!DOCTYPE html&gt;"
      html = html + "&lt;html&gt;"
      html = html + "&lt;body&gt;" 
      html = html + "&lt;h1&gt;Hello World, look at this image &lt;img width=\"100\" src=\"data:image/png;base64,\(dataString)\"&gt;&lt;/h1&gt;"
      html = html + "&lt;/body&gt;"
      html = html + "&lt;/html&gt;" 
      return html 
  }
  </code></pre>