<p>I'm working on an email solution in SQL Server ONLY that will use Database Mail to send out HTML formatted emails.  The catch is that the images in the HTML need to be embedded in the outgoing email. This wouldn't be a problem if I were using a .net app to generate &amp; send the emails but, unfortunately, all I have is SQL Server.</p>

<p>Is it possible for SQL Server to embed images on its own?</p>

[{'answer_id': 36173, 'author': 'nathan_jr', 'author_id': 3769, 'author_profile': 'https://Stackoverflow.com/users/3769', 'pm_score': 1, 'selected': False, 'text': '<p>You could try to encode the image as base64 and reference it directly in an img tag within the email ( <code>&lt;img src="data:image/png;base64[your encoded image here...]</code> ) but i think most email clients correlate this technique with spam. I think you\'re better off referencing hosted images or simply attaching it to the email.</p>\n'}, {'answer_id': 166446, 'author': 'Josef', 'author_id': 5581, 'author_profile': 'https://Stackoverflow.com/users/5581', 'pm_score': 2, 'selected': True, 'text': '<p>Yes, what you need to do is include the images as attachments and then they can be referenced within the HTML.</p>\n\n<p>Use the <code>@file_attachment</code>  parameter of <code>sp_send_dbmail</code></p>\n'}, {'answer_id': 179602, 'author': 'Tomalak', 'author_id': 18771, 'author_profile': 'https://Stackoverflow.com/users/18771', 'pm_score': 2, 'selected': False, 'text': '<p>You have two possibilities:</p>\n\n<ol>\n<li>(easy) Host the images somewhere, and reference them in the <code>&lt;img src="..."&gt;</code>.</li>\n<li>(difficult) Encode them in Base64 and build a multipart MIME message with known content IDs, so they can be referenced in the message body via <code>cid:</code> URIs.</li>\n</ol>\n\n<p>Each possibility has its downsides:</p>\n\n<ol>\n<li>Remote images may not be loaded on the modern e-mail clients for privacy.</li>\n<li>Probably rises spam score.</li>\n</ol>\n\n<p>When the receiving clients are in your control (e.g. same organization), you might be equally fine with either way.</p>\n'}]
['https://Stackoverflow.com/questions/35974', 'https://Stackoverflow.com', 'https://Stackoverflow.com/users/3742/']