DB Mail to send a HTML FORM

  • Hi all,

    When I attempt to send an HTML Table or any other simple text in the syntax of HTML from DB Mail (SQL Server 2k5), it works fine, so all configuration appears fine. However, when I try to add a simple FORM element into the body contents for the @body parameter of sp_send_dbmail, although it doesn't error and i receive the email, the body contains no form. The below example is only displaying "[Go]" in the body of the email. Remove the FORM portion below and put some text in there...no problem - the HTML is rendered as expected; add FORM again and I see neither a form nor a button. I'd like to eventually post form elements from automated emails to a web URL of my choice which will read the posted form and dump some information to SQL Server.

    Any insight is greatly appreciated,

    ike

    DECLARE @tableHTML NVARCHAR(MAX)

    SET @tableHTML =

    N'

  • Sorry, code got cut off before:

    DECLARE @tableHTML NVARCHAR(MAX)

    SET @tableHTML =

    N'

  • The message editor is puking because i am inserting html tags into the @body below. I've had to remove it to show the format i'm using. I'm just inserting a simple html form (html, body, form, and one input button of type = submit)

    EXEC msdb..sp_send_dbmail

    @profile_name = 'MyValidProfile'

    ,@recipients = 'myvalidemail@myvalidcompany.com'

    ,@subject = 'test of HTML form via DBMail'

    ,@body = '[put html tags for a form here, with a button that says Go]'

    ,@body_format = 'HTML'

    ,@importance = 'Low'

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

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