sp_send_dbmail does NOT download the image in outlook

  • Outlook says 'to prevent your privacy outlook prevented the image download' I don'y want users to right click and download image from the 'empty box'.

    Here is my code:

    SET @EMAIL_CONTENT = '<html>'+CHAR(10)

    + ' <body>'

    + ' <p> '

    + ' Happy Birthday..! '

    + ' <span style="font-size:large;">'

    + @FIRST_NAME

    + ' </span>' +CHAR(10)

    + ' </p>'

    + ' <img src="http://mdcweb/images/HR/HR_Birthday.gif" '+CHAR(10)

    + ' width="900"'+CHAR(10)

    + ' height="620"'+CHAR(10)

    + ' border="0"'+CHAR(10)

    + ' alt="my picture">'+CHAR(10)

    + '

    '+CHAR(10)

    + ' </body>'+CHAR(10)

    + ' </html>'+CHAR(10)

    /* Birthday e-mail */

    EXEC msdb.dbo.sp_send_dbmail

    @profile_name = 'DBA_NOTIFICATION',

    @body_format = 'HTML',

    @recipients = @OVERRIDE_EMAIL,

    @copy_recipients = @OVERRIDE_EMAIL,

    @subject = 'Happy Birthday!',

    @body = @EMAIL_CONTENT

    How can I display the image ?

  • In order to "show" the image, you have to download it. You're inlining HTML into the message, so outlook is by default going to pop up that security mesage.

    2 options:

    - take the link out

    - send a link to a web page. When you click on the link, it takes you to the page with the HR picture AND whatevre message you want.

    I guess this qualifies as a 3rd option, but you could also just turn off the security prompt (that's usually not a great idea so I didn't really want to mention it).

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • No that is not I am expecting. The image must display in the outlook message body area.

  • niladri_chatterjee (11/17/2014)


    No that is not I am expecting. The image must display in the outlook message body area.

    Then you need to deal with the security issue within Outlook. There's nothing per se in SQL Server preventing that. It's under Options, Trust Center (at least in the version I have on my desk). If the image is originating from a site not flagged as trusted, it will run into those criteria.

    ----------------------------------------------------------------------------------
    Your lack of planning does not constitute an emergency on my part...unless you're my manager...or a director and above...or a really loud-spoken end-user..All right - what was my emergency again?

  • I'm having the same exact problem with Outlook 2003 (yeah that's not a typo)

    I cc'd the email to Yahoo, etc. and co-workers with higher versions and it works fine.

    Suggestion my boss told me was adding "N" in front of the img URL like below

    N'<img src="http://...........net/icons2/mtaBlk_ver3.png">

Viewing 5 posts - 1 through 4 (of 4 total)

You must be logged in to reply to this topic. Login to reply