Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
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.
Hii nicolas.
Try this :
var strEmailBody =new StringBuilder(umbraco.library.ReplaceLineBreaks(Model.mailBody));
Hope that help.
Cheers
Yes! You made it.
Thanks Gilad.
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)
@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.
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
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.
What am I doing wrong ?
Thanks,
Nicolas.
Hii nicolas.
Try this :
Hope that help.
Cheers
Yes! You made it.
Thanks Gilad.
Cheers
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.
@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.
is working on a reply...