title: Bitmap image attachment to outlook 365 email
body: <p>I'm able to successfully create a bitmap object and save it locally. What I would like to do though is either embed this image into the email or save it into the memory stream and add it as an attachment to the email. </p>
  
  <p>I've tried the code below with some success:</p>
  
  <pre><code> using (var stream = new MemoryStream())
              {
                  bitmap.Save(stream, System.Drawing.Imaging.ImageFormat.Jpeg);
  
  
                  string tempFilePath = Path.GetTempPath() + "test.jpg";
                  FileStream fs = new FileStream(tempFilePath, FileMode.Create);
  
                  stream.CopyTo(fs);
                  fs.Close();
                  mailItem.Attachments.Add(tempFilePath, Microsoft.Office.Interop.Outlook.OlAttachmentType.olByValue, 1, "test.jpg");
  
  
  
              }
  </code></pre>
  
  <p>The issue is that when I open this image, I get the message "It looks like we don't support this file format". I'm not sure why this issue is happening. I've already tried to convert the image to base 64 and then attempting to use it in an html tag, but it doesn't seem like image embedding is supported in this version of outlook. Your assistance is appreciated.</p>