I can use msdb.dbo.sp_send_dbmail to send html email. This is very good for text only in terms of format. For instance:
EXEC msdb.dbo.sp_send_dbmail @recipients = @p_recipients, @subject = @v_subject, @ body=@emailHTML , @body_format = 'HTML';
However, if I want to include images, such as trends, created from data on my SQL server, and embed them in html (@emailHTML), which html tag should I use?
If I use the [img] tag, then I need to set the src attribute. The generated image is saved on my local SQL Server hard drive. I could place them in the web page area of ββthe IS server. But all these web servers are available within the network, but not outside of my work.
Is there a way to insert an image in an email? How can I install html for embedding images?
I use Microsoft SQL Server 2005. I prefer msdb.dbo.sp_send_dbmail to send reports as email. I have a lot of control over the html format. If this is not the case, I may need to send the images as attachment files.
source share