I am writing plain text to email body using StringBuilder
. the line does not gets added in all the desired places.
So far I have tried. Both don't create the desired line all the time.
builder.Append("\r\n");
builder.Append(Environment.NewLine);
here is part of my code:
builder.Append("question 1: ");
builder.Append(CommonUtilities.GetYESNOfromBOOL(bo.GetAnswer1));
builder.Append(Environment.NewLine);
builder.Append("question 2: ");
builder.Append(CommonUtilities.GetYESNOfromBOOL(bo.GetAnswer2));
builder.Append(Environment.NewLine);
builder.Append("question 3: ");
builder.Append(CommonUtilities.GetYESNOfromBOOL(bo.GetAnswer3));
builder.Append(Environment.NewLine);
Result:
question 1: No
question 2: Yes question 3: No
Desired Result:
question 1: No
question 2: Yes
question 3: No
If I add two builder.Append(Environment.NewLine) as supposed to one, it would create two double lines (but I can't get it to break a line at the third question). I have several of these questions and this happens randomly (no pattern).
Any suggestion on how to force a single line.