title: Images breaking when sending mail using SmtpClient
body: <p>I am sending a mail using C# using the <code>SmtpClient</code> class. I am doing the following things before sending the mail.</p>
  
  <pre><code>var mailMessage = new MailMessage();
  
  model.ToAddresses.ForEach(to =&gt; mailMessage.To.Add(to));
  mailMessage.Subject = "Test Email - By Yasser";
  
  mailMessage.Body = String.Format("{0}{1}{2}",
                                      "&lt;html&gt;&lt;body&gt;",
                                       GetEmailContent(model),
                                       "&lt;/body&gt;&lt;/html&gt;");
  mailMessage.IsBodyHtml = true;
  return MailService.SendEmail(mailMessage);
  </code></pre>
  
  <p>and below is my MailService class:</p>
  
  <pre><code>public class MailService
  {
      public static bool SendEmail(MailMessage mailMessage)
      {
          var smtpClient = new SmtpClient();
          try
          {
              smtpClient.Send(mailMessage);
              return true;
          }
          catch(Exception exp)
          {
              return false;
          }
      }
  }
  </code></pre>
  
  <p>Now when I send the mail, the mail gets sent, here is what I get as the content of the mail in outlook when I press the view source. Below is the content of the email with view source (Obviously I have kept only a part of the image data)</p>
  
  <pre><code>&lt;html&gt;
  
  &lt;body&gt;
      &lt;h1&gt;Test&lt;/h1&gt;
      &lt;h2&gt;Hello World&lt;/h2&gt;
      &lt;h3&gt;Missing close h3 tag&lt;/h3&gt;
  
      &lt;p&gt;
          &lt;a href="www.google.com"&gt;
              &lt;img src="data:image/gif;base64,/9j/4AAQSkZJRgABAgEAYABgAAD/4Q8HRXhpZgAAT" /&gt;
          &lt;/a&gt;
      &lt;/p&gt;
  &lt;/body&gt;
  
  &lt;/html&gt;
  </code></pre>
  
  <p>So this appears broken(the images) in the mail, but when I copy this source and paste it into an editor and open the file using a browser all seems good (even the images).</p>
  
  <p>Update : Added image of the mail from outlook</p>
  
  <p><img src="https://i.stack.imgur.com/kBOXY.png" alt="enter image description here"></p>
  
  <p>Any ideas ????</p>