title: Mvc .Net.Mail: How to send email with image (logo)
body: <p>I am using three classes to send email but i cant to combine text email with image, or just to send image. When i get email i see empty image.
  Help me to change my code so i can to send email with:</p>
  
  <ol>
  <li>text</li>
  <li>image</li>
  <li><p>and style</p>
  
  <pre><code>   public class SendService : IDistributionProvider
   {
     public int Send(System.Xml.Linq.XDocument recipientsData, string subject, string fromName, string fromAccount)
  {
      foreach (XElement element in recipientsData.Root.Elements())
      {
          string email = element.Element("email").Value;
          string name = element.Element("name").Value;
          string message = element.Element("message").Value;
  
          bool result = EmailUtils.SendEmail(fromAccount, fromName, email, name, subject, message.Replace("\n", "&lt;br/&gt;"));
      }
  
      return 1;
  }
  
  
  public interface IDistributionProvider
  {
  int Send(XDocument recipientsData, string subject, string fromName, 
   string fromAccount);
  }
  
  
  public static class EmailUtils
  {
   private static string sendHostName;
   private static int sendPort;
   private static string userName;
   private static string password;
   private static string defaultFromEmail;
   private static string defaultFromName;
  
   static EmailUtils()
   {
      sendHostName = ConfigurationManager.AppSettings["sendHostName"];
      sendPort = int.Parse(ConfigurationManager.AppSettings["sendPort"]);
      defaultFromEmail = ConfigurationManager.AppSettings["fromEmail"];
      defaultFromName = ConfigurationManager.AppSettings["fromName"];
  
      string credential = Utils.DecryptString(ConfigurationManager.AppSettings["credential"]);
      if (!string.IsNullOrEmpty(credential) &amp;&amp; credential.Split(";".ToCharArray()).Length &gt; 1)
      {
          userName = credential.Split(";".ToCharArray())[0];
          password = credential.Split(";".ToCharArray())[1];
      }
  }
  
  public static bool SendEmail(string toEmail, string toName, string subject, string body)
  {
      return SendEmail(defaultFromEmail, defaultFromName, toEmail, toName, subject, body);
  }
  
  public static bool SendEmail(string fromEmail, string fromName, string toEmail, string toName, string subject, string body)
  {
      try
      {
          if (string.IsNullOrEmpty(toEmail))
          {
              return false;
          }
  
          if (string.IsNullOrEmpty(toName))
          {
              toName = toEmail.Substring(0, toEmail.IndexOf("@"));
          }
  
          if (string.IsNullOrEmpty(fromEmail))
          {
              fromEmail = defaultFromEmail;
          }
  
          if (string.IsNullOrEmpty(fromName))
          {
              fromName = defaultFromName;
          }
  
          Message message = new Message();
          message.Charset = "UTF-8";
          message.Subject = Codec.RFC2047Encode(subject, "UTF-8");
          message.From = new Address(fromEmail, fromName);
          message.To.Add(toEmail, toName);
          message.BodyHtml.Format = BodyFormat.Html;
          message.BodyHtml.Charset = "UTF-8";
          message.BodyHtml.Text = body;
  
          return ActiveUp.Net.Mail.SmtpClient.SendSsl(message, sendHostName, sendPort, userName, password, SaslMechanism.Login);
      }
      catch
      {
          return false;
      }
  }
  </code></pre>
  
  <p>}</p></li>
  </ol>
  
  <p>In this way I send email- just text:</p>
  
  <pre><code> string bodyEmail = "&lt;h2&gt;Welcome to website&lt;/h2&gt;&lt;/br&gt;&lt;div&gt;&lt;p&gt;Thank for using website&lt;/p&gt;&lt;/div&gt;";
  
          EmailUtils.SendEmail("xxx@gmail.com","xxxx","Contact",bodyEmail);
  </code></pre>