title: How to embed images in e-mails sent by msdb.dbo.sp_send_dbmail?
body: <p>I'm trying to send e-mails to contacts stored in SQL Server database. The e-mails contain images. </p>
  
  <pre><code>EXEC msdb.dbo.sp&amp;#95;send&amp;#95;dbmail&lt;br/&gt;
     @recipients = 'name@address.com;',&lt;br/&gt;
     @subject = 'Sending Mail from SQL Server Test',&lt;br/&gt;
     @file_attachments = 'C:\inetpub\wwwroot\pagerror.gif',&lt;br/&gt;
     @body=N'&amp;lt;img src="pagerror.gif" /&amp;gt;',&lt;br/&gt; 
     @body_format = 'HTML';
  </code></pre>
  
  <p>but some e-mail providers (like Yahoo) assume the sent mail as spam. What i need is to create the &lt;img&gt; tag like the ones generated by Outlook:</p>
  
  <p>&lt;img width=482 height=675 id="_x0000_i1025" src="cid:image002.png@01CA4B5E.28AE48C0"&gt;</p>
  
  <p>With this tag, Yahoo doesn't assume it as spam. How to process the image so I can refer it like above?</p>
  
  <p>I'm not an advanced SQL Server programmer. I really need a step-by-step tutorial. Please help...</p>