+1 vote

I have a text area where users can give text in paragraph,i want the same message with line breaks to be sent mail to me..I have already give code to mail , 

i.e :

MailMessage message = new MailMessage(from_address, email_to  , Subject, HtmlBody);

but how to include line breaks of message ?

asked Apr 19, 2016 in Computer Science - IT by techdoubt | 33 views

1 Answer

+1 vote
Selected Ans.

Replace the values from textArea say for Eg : msg with newline(\n) to break (<br>)

var getMsg = msg.Value.Replace("\r\n", "<br />");
answered Apr 19, 2016 by slow_learner
selected Apr 21, 2016 by techdoubt