I have sent mail using SMTP (ASP.NET).
I have written text in one line only, but I want to be in next line.
I used \n
, but it's not working.
You can then add a <br/> tag to allow a new line.
To add a line break to your HTML code, you use the <br> tag. The <br> tag does not have an end tag. You can also add additional lines between paragraphs by using the <br> tags. Each <br> tag you enter creates another blank line.
Use Encoding %0D%0A in mailto body to line break. This is the only valid way to generate a line break of content/text in the body.
Answer: Use the Newline Characters ' \n ' or ' \r\n ' You can use the PHP newline characters \n or \r\n to create a new line inside the source code.
System.Environment.NewLine
If you format your email as HTML you can add a <br />
to it.
To format as HTML use the IsBodyHtml property of the MailMessage class.
http://msdn.microsoft.com/en-us/library/system.net.mail.mailmessage.isbodyhtml.aspx
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With