Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Sending email

Status
Not open for further replies.

cleanair4me

Technical User
May 16, 2008
61
For sending email (with HTML tags) what is the best one to use?

I am using this now where it works except where I have <br> in the message it doesnt add the newline to my output. Please advise if there is something else I can use beside setContent?
Code:
// Setting the Subject and Content Type
    msg.setSubject(subject);
    msg.setContent(message, "text/html");
    Transport.send(msg);

Example of my what is in my message where everything works in the Outlook email output except the <br> tag.
Code:
String message = "";
message += "Here is my link <a href='myaddresshere.com'>link</a><br>";
message += "<font color='green'>Next line of info here.</font><br>";
message += "<strong>Another line here</strong>";
 
Try the new line char instead.
Either "/n "
OR for system independence use
System.getProperty("line.separator");
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top