SP_SEND_DBMAIL Issue with HTML

  • Hi

    I am generating a HTML to send it as mail using the "sp_send_dbmail"

    following is my query

    SELECT td=T.[TASK_NAME],'',

    td = RES_NAME, '' ,

    td = [TASK_PCT_COMP], '' ,

    td = CONVERT(VARCHAR,[TASK_START_DATE],6), '' ,

    td = CONVERT(VARCHAR,[TASK_FINISH_DATE],6), '',

    td=cast('<a href="Parth">....</a>' as nvarchar(255)),' 'FROM [ProjectServer_Published_e2e].[dbo].[MSP_ASSIGNMENTS]A,[ProjectServer_Published_e2e].[dbo].[MSP_Tasks] T,

    [ProjectServer_Published_e2e].[dbo].[MSP_TASK_BASELINES_WORKING_VIEW] T1,

    [ProjectServer_Published_e2e].[dbo].[MSP_RESOURCES] R

    WHERE T.TASK_UID=A.TASK_UID AND T.PROJ_UID=A.PROJ_UID AND T.Task_Is_Summary<>1 AND

    R.RES_UID=A.RES_UID AND T1.PROJ_UID=A.PROJ_UID AND T1.TASK_UID=A.TASK_UID AND T1.TASK_UID=T.TASK_UID

    AND ASSN_PCT_WORK_COMPLETE <> 100

    FOR XML PATH( 'tr')

    Now everything works fine but i am getting the result like this

    &l t;a href="Parth"&g t;....&l t;/a&g t;instead of

    <td><a href="Parth">Test</a></td>

    because it understand it as the string not as the HTML

    any solution around this??

    Thanks

    Parth

  • Add parameter @body_format = 'HTML'

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

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