Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Getting no effect of " \n" while using setContent()  RSS feed

 
Dash Abhisek
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,
I am new to java mail service.I have a doubt.




the content parameter that I am using inside setContent method has
some new line characters(\n) and a hyperlink also ,when I send the mail
I get the hyperlink but the contents are not shown in separate lines.
I tried using setText I am getting content in different lines but the
hyperlink is not visible

what should I do to get my contents in different lines as well as the hyperlink

Thanks
 
Dash Abhisek
Ranch Hand
Posts: 63
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi All,

I introduced "<br></br>" instead of "\n" and it is working. but still then
I want to know if you have a better solution to this problem.

Thanks
Abhisek
[ November 12, 2008: Message edited by: Dash Abhisek ]
 
Ben Zahler
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi,
i do not really know the api, but since you've set the mime type of the content to text/html, everything inside will be interpreted as html.

maybe a different mime type would solve your problem...
 
Rob Spoor
Sheriff
Posts: 20893
81
Chrome Eclipse IDE Java Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Originally posted by Dash Abhisek:
Hi All,

I introduced "<br></br>" instead of "\n" and it is working. but still then
I want to know if you have a better solution to this problem.

Actually, for HTML that is the correct symbol for line break.

Well, almost. <br> should not have an end tag. So just <br> is fine, and if you want to please XHTML as well you can use <br/>. </br> should never be used.
[ November 13, 2008: Message edited by: Rob Prime ]
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!