title: C#. How to avoid image attached while sending mail
body: <p>I am trying to send email from my.net application.
  I have included an image in it. I get the image in the email. Issue is the image is coming also as an attachment. 
  I need only the inline image. Not attachment. Any option to remove the attachment?
  I have include the code below</p>
  
  <pre><code> body = "&lt;!DOCTYPE HTML PUBLIC \"-//W3C//DTD HTML 4.0 Transitional//EN\"&gt;";
                      body += "&lt;HTML&gt;&lt;HEAD&gt;&lt;META http-equiv=Content-Type content=\"text/html; charset=iso-8859-1\"&gt;";
                      body += "&lt;/HEAD&gt;&lt;BODY&gt;&lt;DIV&gt;&lt;FONT face=Arial color=#ff0000 size=2&gt;this is some HTML text";
                      body += "&lt;/FONT&gt;&lt;/DIV&gt;&lt;DIV&gt;&lt;img width=600 height=100 id=\"_x0000_i1028\" src=\"cid:cid1\" alt=\"KPMG LINK\"&gt;&lt;/DIV&gt;&lt;/BODY&gt;&lt;/HTML&gt;";
                      AlternateView alternate = AlternateView.CreateAlternateViewFromString(body, null, "text/plain");
                      AlternateView alternateHtml = AlternateView.CreateAlternateViewFromString(body, null, "text/html");
                      LinkedResource resource = null;
                      resource = new LinkedResource(ImagePath, new ContentType("image/png"));
                      resource.ContentId = "cid";
                      alternate.LinkedResources.Add(resource);
                      message.AlternateViews.Add(alternate);
                      message.AlternateViews.Add(alternateHtml);                        
  
                      smtp.Send(message);
  </code></pre>