Carriage Return, Line Feed not working when trying to format the body of email

  • I'm attempting to format the body of an e-mail message.

    I can't use Database mail in this case; I'm using CDONTS.NewMail.

    I have a cursor that calls the CDONTS.NewMail Procedure.

    I tried the FormatBody Property and tried to use HTML to format the body but I did not get it right.

    So I was trying (very lame approach) to format the e-mail using Tabs, space, Carriage Returns and Line Feeds.

    The CR & LF in the following does not work.

    Any help would be greatly appreciated.

    DECLARE @Message VARCHAR(4000)

    DECLARE @NewLineChar CHAR(2)

    SET @NewLineChar = CHAR(13) + CHAR(10)

    SET @Message = ' ' +

    'YOUR INCENTIVE SCORECARD' + @NewLineChar +

    'Thank you for participating in our new Business Production Incentive. Since October 17th you Agency has issued'

    SELECT @Message AS Message

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

  • For HTML use "

    " (that is lessThan BR greaterThan) for line break.

    as expected the HTML line break was implemented literally in my reply. 🙂

    The probability of survival is inversely proportional to the angle of arrival.

  • Disregard this post, I'm going with an HTML solution.

    For better, quicker answers on T-SQL questions, click on the following...
    http://www.sqlservercentral.com/articles/Best+Practices/61537/

    For better answers on performance questions, click on the following...
    http://www.sqlservercentral.com/articles/SQLServerCentral/66909/

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

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