• Post Reply Bookmark Topic Watch Topic
  • New Topic

How do I put a hyperlink in a programatically sent email message?  RSS feed

 
chinomso ikwuagwu
Greenhorn
Posts: 11
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How do I put a hyperlink in a programatically sent email message?
A MimeMessage was created using the default javax.mail.Session and
the MimeMessage's content was set to "text/html".

The message was constructed as shown below.

String message = "<html>" +
"<head><title>"+subject+"</title></head>" +
"<body>" +
"Click <a href=\"" + returnAddress + "\">here</a> to activate your free subscription." +
"</body>" +
"</html>";

//Grateful for any assistance
 
D Rog
Ranch Hand
Posts: 472
Linux Objective C Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Set this message string as e-mail body. You do not need anything special. Most of e-mail client will show and process the link correctly.
 
Don't get me started about those stupid light bulbs.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!