K
killjoy
Hi,
I have a web app. that runs on weblogic 8.1 sp4 on windows XP.
Normally, it sends e-mails (text and html) with no trouble. However, I
need to put a hyperlink in a mail message using below code snipped;
Session session = (Session) ic.lookup("mySession");
MimeMessage msg = new MimeMessage(session);
msg.setFrom();
msg.setHeader("X-Mailer", "sendhtml");
msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(email,
false));
msg.setSentDate(new Date());
msg.setSubject(subject,"ISO-8859-9");
MimeBodyPart mbp = new MimeBodyPart();
String tst = "<html><body><table border='1'><tr><td><a
href='http:\\www.yahoo.com'>xxxxx</a></td></tr><tr><td>yyy</td></tr></table></body></html>";
mbp.setDataHandler(new DataHandler(tst, "text/html;
charset=ISO-8859-9"));
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp);
msg.setContent(mp);
Transport.send(msg);
My app. doesn't send this e-mail. But, when I change
href='http://www.yahoo.com' to href='' mail is sent successfully.
How can I make it work?
Thanks in advance
Murat
I have a web app. that runs on weblogic 8.1 sp4 on windows XP.
Normally, it sends e-mails (text and html) with no trouble. However, I
need to put a hyperlink in a mail message using below code snipped;
Session session = (Session) ic.lookup("mySession");
MimeMessage msg = new MimeMessage(session);
msg.setFrom();
msg.setHeader("X-Mailer", "sendhtml");
msg.setRecipients(Message.RecipientType.TO,InternetAddress.parse(email,
false));
msg.setSentDate(new Date());
msg.setSubject(subject,"ISO-8859-9");
MimeBodyPart mbp = new MimeBodyPart();
String tst = "<html><body><table border='1'><tr><td><a
href='http:\\www.yahoo.com'>xxxxx</a></td></tr><tr><td>yyy</td></tr></table></body></html>";
mbp.setDataHandler(new DataHandler(tst, "text/html;
charset=ISO-8859-9"));
Multipart mp = new MimeMultipart();
mp.addBodyPart(mbp);
msg.setContent(mp);
Transport.send(msg);
My app. doesn't send this e-mail. But, when I change
href='http://www.yahoo.com' to href='' mail is sent successfully.
How can I make it work?
Thanks in advance
Murat