Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • nicolas ruiz 74 posts 95 karma points
    Jun 20, 2012 @ 09:49
    nicolas ruiz
    0

    StringBuilder, textbox multiple property and line breaks

    Hey folks,

    I'm sending a mail after have retrieved and proceed the body message based on the textbox multiple page property.

    Problem is that the line breaks are not keeped ('\n')... My mail is sent 'flat', all lines shrunk in one.

    var strEmailBody = new StringBuilder(@Model.mailBody);

    What am I doing wrong ?

    Thanks,

    Nicolas.

  • gilad 185 posts 425 karma points
    Jun 20, 2012 @ 09:53
    gilad
    0

    Hii nicolas.

    Try this : 

    var strEmailBody =new StringBuilder(umbraco.library.ReplaceLineBreaks(Model.mailBody));

    Hope that help.

    Cheers

  • nicolas ruiz 74 posts 95 karma points
    Jun 20, 2012 @ 09:58
    nicolas ruiz
    0

    Yes! You made it.

    Thanks Gilad.

    Cheers

  • nicolas ruiz 74 posts 95 karma points
    Jun 20, 2012 @ 10:02
    nicolas ruiz
    0

    But ... that replaces \n by <br> right ?

    I's expecting to keep my \n tags so my mail would be sent in text mode (no html)

    Thanks,

    Nicolas.

  • Douglas Ludlow 210 posts 366 karma points
    Jun 20, 2012 @ 19:57
    Douglas Ludlow
    0

    @nicolas ruiz, how are you sending the email? It's possible that even though you want to send the email plaintext that it's still being sent as html and therefore \n characters will be ignored.

Please Sign in or register to post replies

Write your reply to:

Draft