943,852 Members | Top Members by Rank

Ad:
  • Java Discussion Thread
  • Unsolved
  • Views: 6183
  • Java RSS
Nov 7th, 2007
0

hyperlink in java mail

Expand Post »
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
Similar Threads
Reputation Points: 10
Solved Threads: 0
Light Poster
balagangadharm is offline Offline
26 posts
since Oct 2007
Nov 7th, 2007
0

Re: hyperlink in java mail

Simply include the url. Whether or not that url becomes a "hyperlink" depends on the tool being used to view the mail.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Nov 7th, 2007
0

Re: hyperlink in java mail

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
Reputation Points: 10
Solved Threads: 0
Light Poster
balagangadharm is offline Offline
26 posts
since Oct 2007
Nov 7th, 2007
0

Re: hyperlink in java mail

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.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Nov 7th, 2007
0

Re: hyperlink in java mail

ok atleast plz tell this.
Iam unable to send mail rediffmail using javamail.can u plz tell me y
Reputation Points: 10
Solved Threads: 0
Light Poster
balagangadharm is offline Offline
26 posts
since Oct 2007
Nov 7th, 2007
0

Re: hyperlink in java mail

No, as I have no idea what you mean by "rediffmail".
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Nov 7th, 2007
0

Re: hyperlink in java mail

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.
Reputation Points: 21
Solved Threads: 10
Junior Poster
Paul.Esson is offline Offline
181 posts
since Feb 2005
Nov 7th, 2007
0

Re: hyperlink in java mail

Click to Expand / Collapse  Quote originally posted by Paul.Esson ...
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.
Moderator
Reputation Points: 1471
Solved Threads: 490
Industrious Poster
masijade is offline Offline
4,043 posts
since Feb 2006
Nov 7th, 2007
0

Re: hyperlink in java mail

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).
Team Colleague
Reputation Points: 1658
Solved Threads: 331
duckman
jwenting is offline Offline
7,719 posts
since Nov 2004
Nov 7th, 2007
0

Re: hyperlink in java mail

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.
Reputation Points: 21
Solved Threads: 10
Junior Poster
Paul.Esson is offline Offline
181 posts
since Feb 2005

This thread is more than three months old

No one has posted to this discussion for at least three months. Please let old threads die and do not reply to them unless you feel you have something new and valuable to contribute that absolutely must be added to make the discussion complete. Otherwise, please start a new thread in this forum instead.
Message:
Previous Thread in Java Forum Timeline: JDBC Connection Pooling : Network Adapter could not establish the connection
Next Thread in Java Forum Timeline: Need Help with JFrame





About Us | Contact Us | Advertise | Acceptable Use Policy
Forum Index | Build Custom RSS Feed


Follow us on Twitter


© 2011 DaniWeb® LLC