On Nov 7, 12:59*am, "Peter Duniho" <NpOeStPe...@nnowslpianmk.com>
wrote:
On Thu, 06 Nov 2008 15:11:09 -0800, shapper <mdmo...@gmail.comwrote:
[...]
How should I create empty lines? User various ApendLine as n the
previous example or maybe using <br />:
* * StringBuilder body = new StringBuilder();
* * body.AppendFormat("{0},<br/><br/>", userName);
* * body.AppendLine("How are you?");
I don't understand the above example. *.NET doesn't do anything special*
with HTML elements. *So appending "<br/>" doesn't insert line-breaks into *
your string.
AppendLine() should be fine, or you can append the Environment.NewLine *
character.
Pete
But if I am sending the email Html format won't I get the line breaks
by using <br/in my string?
Basically, at the end I do: myMail.Body = body.ToString();
I've also read the following:
http://www.systemnetmail.com/faq/4.8.aspx
So I think I have two options:
1. Create an HTML page that contains the email body and send it ...
I think this would be more useful for complex mail bodies like
Newsletters.
2. Use StringBuilder to create the email body and include the needed
HTML tags as <p>, <br/>, etc ...
And if I send a No Html format email I could use:
body.AppendFormat("{0},\n\n", userName);
instead of:
body.AppendFormat("{0},<br/><br/>", userName);
Or not?
Just trying to find the correct way to create the body of Html mail
messages and Non Html mail messages.
Thanks,
Miguel