title: Display base64 images in a html email on Ios
body: <p>I generate a html string who contains base64 images. When the MFMailComposeViewController open, I see the images in the generated email. When I send it and open it, the images are not displayed, there are just empty square.</p>
  
  <p>My code</p>
  
  <pre><code>- (IBAction)actionShareByEmail:(id)sender {
  
      if([MFMailComposeViewController canSendMail])
      {
          MFMailComposeViewController *picker = [[MFMailComposeViewController alloc] init];
          picker.mailComposeDelegate = self;
  
          NSString* subject = @"Environments list with qrcode";
          [picker setSubject:subject];
          [picker setMessageBody:[manager getHtmlWithEnvironments:nil] isHTML:YES];
          [self presentViewController:picker animated:YES completion:nil];
      }
  }
  
  -(NSString*)getHtmlWithEnvironments:(NSArray*)envDictionnaries{
      NSMutableString* html = [[NSMutableString alloc]init];
      [html appendString: @"&lt;html&gt;&lt;body&gt;"];
  
      for (NSDictionary *d in self.arEnvironments) {
  
          UIImage* qrcode = [QRCodeGenerator qrImageForString:[d objectForKey:@"env_name"] imageSize:200.0];//Works fine
          NSData *imageData = UIImagePNGRepresentation(qrcode);
          NSString *encodedString = [imageData base64EncodedStringWithOptions:NSDataBase64Encoding64CharacterLineLength];
          [html appendString: [NSString stringWithFormat:@"&lt;H3&gt;%@&lt;/h3&gt;&lt;img src=\"data:image/png;base64,%@\" width=\"200\" height=\"200\" alt=\"test\" /&gt;&lt;/br&gt;&lt;/br&gt;",[d objectForKey:KEY_ENV_NAME],encodedString]];
      }
      [html appendString: @"&lt;/html&gt;&lt;body&gt;"];
  
      return html;
  }
  </code></pre>
  
  <p>How can I do to display images correctly ?</p>