Wednesday, October 5, 2011

New Line (VB.NET)

How to embedd a new line into body of the message sent from the aspx-form? I tried several combinations including
"<br>", "\n" and "\r\n". It does not work in ASPX-environment. Searching the Internet, I found interesting solution
which works for me.

message.Body = "This message was sent by " + name
message.Body += Environment.NewLine + "from email address " + email
message.Body += Environment.NewLine + "Organization: " + org
message.Body += Environment.NewLine + "Phone: " + phone
message.Body += Environment.NewLine + "Fax: " + fax
message.Body += Environment.NewLine + "Request " + data

No comments:

Post a Comment