Problem with sp_send_dbmail and HTML

  • Hi all,

    I'm trying to send a simple HTML email using sp_send_dbmail, i can send some email but others cause me trouble.

    I'm on SQL Server 2005, SP1, Standard Edition x64

    Working:

    exec msdb..sp_send_dbmail @recipients='MyEmail.com',@subject='test',@body='<html><body><h1>test</h1></body></html>',@body_format='HTML'

    exec msdb..sp_send_dbmail @recipients='MyEmail.com',@subject='test',@body='test',@body_format='TEXT'

    NOT working:

    But i receive the message 'Mail queued.'

    as body in the 1st working

    <html><body><a href="www.test.com">test</a></body></html>

    <html><body><a href=www.test.com>test</a></body></html>

    i even try, these: As posted on some google forum.

    set @sBody = REPLACE( @sBody, '&lt;', '<' )

    set @sBody = REPLACE( @sBody, '&gt;', '>' )

    set @sBody = REPLACE( @sBody, '&amp;', '&' )

    Any idea?

    Thank you


    Best Regards,

    David, MCAD.NET

  • Thanks to all, but my mistake, email went to junk! What a beginner mistake


    Best Regards,

    David, MCAD.NET

Viewing 2 posts - 1 through 1 (of 1 total)

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