Package com.emc.plants.pojo.beans

Examples of com.emc.plants.pojo.beans.EMailMessage


   */
  public void createAndSendMail(CustomerInfo customerInfo, long orderKey) throws MailerAppException
  {
    try
    {
      EMailMessage eMessage = new EMailMessage(createSubjectLine(orderKey),
          createMessage(orderKey),
          customerInfo.getCustomerID());
      Util.debug("Sending message" +
          "\nTo: " + eMessage.getEmailReceiver() +
          "\nSubject: " + eMessage.getSubject() +
          "\nContents: " + eMessage.getHtmlContents());
     
      //Session mailSession = (Session) Util.getInitialContext().lookup(MAIL_SESSION);
     
      MimeMessage msg = new MimeMessage(mailSession);
      msg.setFrom();
     
      msg.setRecipients(Message.RecipientType.TO,
          InternetAddress.parse(eMessage.getEmailReceiver(), false));
     
      msg.setSubject(eMessage.getSubject());
      MimeBodyPart mbp = new MimeBodyPart();
      mbp.setText(eMessage.getHtmlContents(), "us-ascii");
      msg.setHeader("X-Mailer", "JavaMailer");
      Multipart mp = new MimeMultipart();
      mp.addBodyPart(mbp);
      msg.setContent(mp);
      msg.setSentDate(new Date());
View Full Code Here

TOP

Related Classes of com.emc.plants.pojo.beans.EMailMessage

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.