Hello All,
          I am able to send an HTML Formated Newsletter(containing hyperlinks) through JavaMail  API.But the problem is that  
          when the recepient clicks on any of the links, it opens a new browser window but does not display the proper page...
          The code being used is as follow...
 
  //code...
     URL url = new URL(newsletterName);
     Message msg = new MimeMessage(session);
     msg.setFrom(new InternetAddress(eMess.getEmailSender()));
     String to = "";
     msg.setRecipients(Message.RecipientType.TO,
                     InternetAddress.parse(to, false));
     msg.setRecipients(Message.RecipientType.BCC,
                     InternetAddress.parse(eMess.getEmailReceiver(), false));
     msg.setSubject(eMess.getSubject());
     MimeBodyPart messageBodyPart = new MimeBodyPart();
     messageBodyPart.setText("");
     MimeMultipart multipart = new MimeMultipart("related");
            multipart.addBodyPart(messageBodyPart);
    messageBodyPart = new MimeBodyPart();
    DataSource fds = new URLDataSource(url);
    messageBodyPart.setDataHandler(new DataHandler(fds));
    multipart.addBodyPart(messageBodyPart);
    msg.setContent(multipart);
    Transport.send(msg);
 

 Please help me out with the problem.Thanks a million in advance...
 
Regards
SSMTech

Reply via email to