title: Embedding image in html body want show as well
body: <p>I need to send mail with which have mixture of pictures and texts. My problem is that can't send image inside of body, it always appear at bottom op body.</p>
  
  <p>So my question is <strong>how to send write position picture inside of email body</strong>?</p>
  
  <p>Here is code which don't work as well</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.IO;
  using System.ComponentModel;
  using System.Data;
  using System.Drawing;
  using System.Linq;
  using System.Text;
  using System.Windows.Forms;
  using System.Web;
  using System.Net;
  using System.Net.Mail;
  using System.Threading;
  using System.Web;
  using System.Net.Mime;
  using WindowsFormsApplication5.Properties;
  
  namespace WindowsFormsApplication5
  {
      public partial class Form1 : Form
      {
          public Form1()
          {
              InitializeComponent();
          }
  
      private void Form1_Load(object sender, EventArgs e)
      {
  
      }
  
      private void button1_Click(object sender, EventArgs e)
      {
          MailMessage msg = new MailMessage();
  
          string To;
  
          To = Properties.Settings.Default.To.ToString();
  
          msg.To.Add("some.name@gmail.com");
          msg.From = new MailAddress("your.adress@gmail.com");
          msg.Subject = "Subject";
  
          string path = "C:\\root.jpg"; // my logo is placed in images folder
  
          LinkedResource logo = new LinkedResource(path, MediaTypeNames.Image.Jpeg);
          logo.ContentId = "companylogo";
          logo.TransferEncoding = TransferEncoding.Base64;
  
          //now do the HTML formatting
          AlternateView av1 = AlternateView.CreateAlternateViewFromString(
                "&lt;html&gt;&lt;body&gt;" + "&lt;p&gt;This will have to be before picture&lt;/p&gt;" + "&lt;img src=cid:companylogo/&gt;" + "&lt;p&gt;This will have to be after pictures.&lt;/p&gt;" +
                "&lt;br&gt;&lt;/body&gt;&lt;/html&gt;",
                null, MediaTypeNames.Text.Html);
  
          //now add the AlternateView
          av1.LinkedResources.Add(logo);
  
          //now append it to the body of the mail
          msg.AlternateViews.Add(av1);
          msg.IsBodyHtml = true;
  
          SmtpClient smtp = new SmtpClient();
          smtp.Host = "smtp.gmail.com";
  
          smtp.Port = 587;
  
          //for gmail
          smtp.EnableSsl = true;
          smtp.Credentials = new System.Net.NetworkCredential(
               "your.adress@gmail.com",
               "password");
  
          smtp.Send(msg);
      }
  }
  }
  </code></pre>
  
  <p>I tested on gmail client and here is what i get:</p>
  
  <p><img src="https://i.stack.imgur.com/BahwQ.png" alt="enter image description here"></p>