link in java

hi guys

I have a method to send a email which goes like this

public boolean sendEmail(String id){
String from = "";
String to = "";
String subject = "You have a new message;
String text = " you have new message" +
      "Please log into the application and take a look."

I want the application to be a hyperlink which should point to +"http://localhost:9081/flexweb/login.jsp"  .

any idea how i can do that?


Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Such a url would only be of use to people receiving mail on the same machine as the one running a service on port 9081. Is that what you want?

Do you know which mail program are using your recipients?

I don't think you can do it for all possible email clients
which people use, but for some most popular you can do

In particular in Outlook which I use any strings like you showed
in the text of the message (maybe sperated by spaces from
other stuff will be shiown and will act as links)
royjaydAuthor Commented:
>>>Such a url would only be of use to people receiving mail on the same machine as the one running a service on port 9081. Is that what you want?

yep, already know that. Dont worry about the actual URL value. that is my dev box URL. When application goes to production the URL value will be the one which can be accessed from any system.

CompTIA Network+

Prepare for the CompTIA Network+ exam by learning how to troubleshoot, configure, and manage both wired and wireless networks.

royjaydAuthor Commented:
for_yan, the email is using Outlook in my company.

You just need to use an html-formatted mail with a link in it
We are using Outlook and I just put http://... in the body of the
email like that:

          String sep = System.getProperty("line.separator");
      body += sep;
            body += "" + sep;

I don't even specify html in the header. They are all clicking and are all happy
If you want to make a link out of it, like say

   String sep = System.getProperty("line.separator");
      body += sep;
body += "Click <a href=\"\">here</a>" + sep;

then you swould probably need to have html in the header

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
royjaydAuthor Commented:
good one for_yan. works for me.

By the way, I recently had a challenge very closely related to this question.

We have some home grown application called PBB or something, and I guess they have configured Internet explorer for users,
that when you place in the address line of IE something like
it opens some_address using this application. And now they also wanted to click on such pbb:... link inside the email.
But outlook does not want to recognize it the same way as it recognizes http://...

Well, eventually I figured out how to do it creating corresponding http://...  files
and using them for redirection to "pbb:..." - and writing different address into each
redirection file, and  then it worked, but for couple of days
I thought I'd not be able to resolve this, as I could not find how to configure outlook, so that it could
recognize pbb:... as a link in the same way as http:...

Mick BarryJava DeveloperCommented:
royjaydAuthor Commented:
thanks guys
any help with my next question would be greatly appreciated

It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today

From novice to tech pro — start learning today.