User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the Java section within the Software Development category of DaniWeb, a massive community of 456,611 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,406 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our Java advertiser: Lunarpages Java Web Hosting
Views: 1314 | Replies: 9
Reply
Join Date: Oct 2007
Posts: 25
Reputation: balagangadharm is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
balagangadharm balagangadharm is offline Offline
Light Poster

hyperlink in java mail

  #1  
Nov 7th, 2007
hi everyody,i need ur help.I am able to send subject and text as mail to the recepient but iam unable to send hyperlinks in th text.plz suggest me how to send
Bala Gangadhar Marripeedi m.balagangadhar@gmail.com
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Feb 2006
Posts: 1,519
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 10
Solved Threads: 136
masijade's Avatar
masijade masijade is offline Offline
Posting Virtuoso

Re: hyperlink in java mail

  #2  
Nov 7th, 2007
Simply include the url. Whether or not that url becomes a "hyperlink" depends on the tool being used to view the mail.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Oct 2007
Posts: 25
Reputation: balagangadharm is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
balagangadharm balagangadharm is offline Offline
Light Poster

Re: hyperlink in java mail

  #3  
Nov 7th, 2007
when i send the url (http://192.168.1.21:8080/tarka/resentemail.jsp) to gmail,it working fine and showing the link.but wen i send it to yahoomail,link is not shown but simply a plain text.
my code
String text=" Hello welcome,
click here to enjoy http://192.168.1.21:8080/tarka/resentemail.jsp";
message1.setText(text);
Is this the way.plz suggest. I want to send links in between text.hope u help me
Bala Gangadhar Marripeedi m.balagangadhar@gmail.com
Reply With Quote  
Join Date: Feb 2006
Posts: 1,519
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 10
Solved Threads: 136
masijade's Avatar
masijade masijade is offline Offline
Posting Virtuoso

Re: hyperlink in java mail

  #4  
Nov 7th, 2007
Then ask yahoo mail if there is any thing special you have to do to get yahoo to create "hyperlinks". I don't know why you're asking here, this is not anywhere even close to a Java issue.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Oct 2007
Posts: 25
Reputation: balagangadharm is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
balagangadharm balagangadharm is offline Offline
Light Poster

Re: hyperlink in java mail

  #5  
Nov 7th, 2007
ok atleast plz tell this.
Iam unable to send mail rediffmail using javamail.can u plz tell me y
Bala Gangadhar Marripeedi m.balagangadhar@gmail.com
Reply With Quote  
Join Date: Feb 2006
Posts: 1,519
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 10
Solved Threads: 136
masijade's Avatar
masijade masijade is offline Offline
Posting Virtuoso

Re: hyperlink in java mail

  #6  
Nov 7th, 2007
No, as I have no idea what you mean by "rediffmail".
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Feb 2005
Location: Ballarat, Australia
Posts: 164
Reputation: Paul.Esson is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
Paul.Esson's Avatar
Paul.Esson Paul.Esson is offline Offline
Junior Poster

Re: hyperlink in java mail

  #7  
Nov 7th, 2007
you may have better luck if you send the email as hypertext or have a html attachment.

try just enclosing the url in tags as such

String text=" Hello welcome,
click <a href=\"http://192.168.1.21:8080/tarka/resentemail.jsp\"> here</a> to enjoy ";

see how something like that works.

I don't know what class you are using but I would assume that you can send a HTML attachment, That will be displayed correctly in most mail applications and then any links you send will be displayed correctly.
Reply With Quote  
Join Date: Feb 2006
Posts: 1,519
Reputation: masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light masijade is a glorious beacon of light 
Rep Power: 10
Solved Threads: 136
masijade's Avatar
masijade masijade is offline Offline
Posting Virtuoso

Re: hyperlink in java mail

  #8  
Nov 7th, 2007
Originally Posted by Paul.Esson View Post
you may have better luck if you send the email as hypertext or have a html attachment.

try just enclosing the url in tags as such

String text=" Hello welcome,
click <a href=\"http://192.168.1.21:8080/tarka/resentemail.jsp\"> here</a> to enjoy ";

see how something like that works.

I don't know what class you are using but I would assume that you can send a HTML attachment, That will be displayed correctly in most mail applications and then any links you send will be displayed correctly.


Unless, of course, HTML display is disabled in the Mail tool, which many companies have it disabled by default.

Edit: But, once again, this is still a mail tool problem and has absolutely nothing to do with Java.
Last edited by masijade : Nov 7th, 2007 at 7:38 am.
Java Programmer and Sun Systems Administrator

----------------------------------------------

Debugging is twice as hard as writing the code in the first place. Therefore, if you write the code as cleverly as possible, you are, by definition, not smart enough to debug it.
--Brian Kernighan
Reply With Quote  
Join Date: Nov 2004
Location: Netherlands
Posts: 5,752
Reputation: jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough jwenting is a jewel in the rough 
Rep Power: 19
Solved Threads: 200
Colleague
jwenting's Avatar
jwenting jwenting is offline Offline
duckman

Re: hyperlink in java mail

  #9  
Nov 7th, 2007
you'll need to send the message as html, including the proper mime types for the message content.
JavaMail I think offers that, but I don't know how to activate it (I hate non-text email).
As people are clearly allowed to attack me but I'm not allowed to defend myself, I no longer post to this site.
Reply With Quote  
Join Date: Feb 2005
Location: Ballarat, Australia
Posts: 164
Reputation: Paul.Esson is an unknown quantity at this point 
Rep Power: 4
Solved Threads: 6
Paul.Esson's Avatar
Paul.Esson Paul.Esson is offline Offline
Junior Poster

Re: hyperlink in java mail

  #10  
Nov 7th, 2007
You can send it as a Multipart email with plain text and HTML.

you can find instructions from sun here

All you have to do is add both BodyParts, specifying the mime type of both parts.
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb Java Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the Java Forum

All times are GMT -4. The time now is 7:22 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC