Win a copy of Mesos in Action this week in the Cloud/Virtualizaton forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Problem in Send mail to MS Outlook with hyperlink body using java Mail API

 
yousuf alam
Greenhorn
Posts: 9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Friends,

I am sending mail to Microsoft outlook using java mail API with hyperlink body and text message body.
I am getting text message in body.but i couldnot able to get hyperlink message.i got hyperlink message in attachement.i attached the screenshot for the reference.
But i want to display the hyperlink in body itself.this is my source code.Kinldy help me on this..this is very urgent

protected Message mesg;
mesg = new MimeMessage(session);
mesg.setFrom(new InternetAddress("test@test.com"));
InternetAddress toAddress = new InternetAddress(message_recip);
mesg.addRecipient(Message.RecipientType.TO, toAddress);
InternetAddress ccAddress = new InternetAddress(message_cc);
mesg.addRecipient(Message.RecipientType.CC, ccAddress);
mesg.setSubject(message_subject);

Multipart mp = new MimeMultipart();
BodyPart textPart = new MimeBodyPart();
textPart.setText(textdata);
BodyPart pixPart = new MimeBodyPart();
pixPart.setContent(html_data, "text/html");

mp.addBodyPart(textPart);
mp.addBodyPart(pixPart);
mesg.setContent(mp);
Transport.send(mesg);

mail.png
[Thumbnail for mail.png]
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic