yuson Tiewan
yuson Tiewan

Reputation: 13

Adding signature for mail, not displaying properly

I need to add an signature at the end of the body, heres what I have tried so far.

 msg.Body = (fk.Status + "\n \n \n \n Best Regards \n" + User.Identity.Name.ToString() );

where msg is:

 MailMessage msg = new MailMessage()

But the newline isn't working. The mail is sending fine and everything, but it all comes in a one liner.

Is there a better way to add signature? or a way to manipulate the text?

Upvotes: 1

Views: 50

Answers (2)

teo van kot
teo van kot

Reputation: 12491

If your email is Html use <br/>:

msg.IsBodyHtml = true; // You need this to render mail as html
msg.Body = (fk.Status + @"<br/> <br/> <br/> <br/> Best Regards <br/>" + User.Identity.Name.ToString() );

Upvotes: 1

A3006
A3006

Reputation: 1069

Instead of \n use

system.environment.newline

Or use /r/n

Upvotes: 0

Related Questions