Package javax.mail.internet

Examples of javax.mail.internet.MimeMessage.addRecipients()


      arrayBcc = this.getAddressAddress(bccList);
      arrayCc = this.getAddressAddress(ccList);
      arrayTo = this.getAddressAddress(toList);

      message.addRecipients(Message.RecipientType.TO, arrayTo);
      message.addRecipients(Message.RecipientType.CC, arrayCc);
      message.addRecipients(Message.RecipientType.BCC, arrayBcc);

      message.setFrom(new InternetAddress(fromAddress));
      // So we don't require a Reply-To address
View Full Code Here


      arrayBcc = this.getAddressAddress(bccList);
      arrayCc = this.getAddressAddress(ccList);
      arrayTo = this.getAddressAddress(toList);

      message.addRecipients(Message.RecipientType.TO, arrayTo);
      message.addRecipients(Message.RecipientType.CC, arrayCc);
      message.addRecipients(Message.RecipientType.BCC, arrayBcc);

      message.setFrom(new InternetAddress(fromAddress));
      // So we don't require a Reply-To address
      if (replyToAddress != null && replyToAddress.length() != 0) {
View Full Code Here

      arrayCc = this.getAddressAddress(ccList);
      arrayTo = this.getAddressAddress(toList);

      message.addRecipients(Message.RecipientType.TO, arrayTo);
      message.addRecipients(Message.RecipientType.CC, arrayCc);
      message.addRecipients(Message.RecipientType.BCC, arrayBcc);

      message.setFrom(new InternetAddress(fromAddress));
      // So we don't require a Reply-To address
      if (replyToAddress != null && replyToAddress.length() != 0) {
        message.setReplyTo(new Address[] {new InternetAddress(replyToAddress)});
View Full Code Here

        properties.put("mail.host", JManageProperties.getEmailHost());
        properties.put("mail.from", JManageProperties.getAlertEmailFrom());
        properties.put("mail.transport.protocol", "smtp");
        Session session = Session.getInstance(properties);
        MimeMessage message = new MimeMessage(session);
        message.addRecipients(Message.RecipientType.TO, to);
        message.setSubject(subject);
        message.setText(content);
        Transport.send(message);
    }
}
View Full Code Here

    Iterator iter = listOfContactLists.iterator();
    while (iter.hasNext()) {
      ContactList tmp = (ContactList) iter.next();
      InternetAddress groupName[] = InternetAddress.parse(tmp.getRFC2822Name() + ";");
      InternetAddress members[] = tmp.getEmailsAsAddresses();
      msg.addRecipients(RecipientType.TO, groupName);
      msg.addRecipients(RecipientType.BCC, members);
    }
    msg.saveChanges();
    MailerResult result = new MailerResult();
    MailHelper.sendMessage(msg.getFrom()[0], msg.getRecipients(RecipientType.TO), msg.getRecipients(RecipientType.CC), msg
View Full Code Here

    while (iter.hasNext()) {
      ContactList tmp = (ContactList) iter.next();
      InternetAddress groupName[] = InternetAddress.parse(tmp.getRFC2822Name() + ";");
      InternetAddress members[] = tmp.getEmailsAsAddresses();
      msg.addRecipients(RecipientType.TO, groupName);
      msg.addRecipients(RecipientType.BCC, members);
    }
    msg.saveChanges();
    MailerResult result = new MailerResult();
    MailHelper.sendMessage(msg.getFrom()[0], msg.getRecipients(RecipientType.TO), msg.getRecipients(RecipientType.CC), msg
        .getRecipients(RecipientType.BCC), body + footer, subject, null, result);
View Full Code Here

   
    // Building MimeMessage
    MimeMessage mimeMessage = new MimeMessage(session);
    mimeMessage.setSubject(subject);
    mimeMessage.setFrom(new InternetAddress(from));
    mimeMessage.addRecipients(Message.RecipientType.TO, InternetAddress.parse(recipients, false));
   
    // -- Create a new message --
    BodyPart msg = new MimeBodyPart();
    msg.setDataHandler(new DataHandler(new ByteArrayDataSource(htmlBody, "text/html; charset=\"utf-8\"")));
   
View Full Code Here

    try {
      MimeMessage msg = new MimeMessage(getSession());

      if(_from.length > 0)
        msg.addFrom(_from);
      msg.addRecipients(RecipientType.TO, _to);
      if(subject != null)
        msg.setSubject(subject);
      msg.setContent(body, "text/plain");

      send(msg);
View Full Code Here

    props.put("mail.smtp.host", smtpHost);
    Session session = Session.getInstance(props, null);
    try {
        MimeMessage msg = new MimeMessage(session);
        msg.setFrom(new InternetAddress(from));
        msg.addRecipients(Message.RecipientType.TO, InternetAddress.parse(to));
        msg.setSubject(subject);
        msg.setSentDate(new Date());
        msg.setText(body);
        Transport.send(msg);
    } catch (MessagingException e) {
View Full Code Here

            }
            mail.setFrom(new InternetAddress(sendFrom));
            mail.setSubject(subject, "UTF-8");
            mail.setHeader("X-Mailer", "Apache OFBiz, The Apache Open For Business Project");
            mail.setSentDate(new Date());
            mail.addRecipients(Message.RecipientType.TO, sendTo);

            if (UtilValidate.isNotEmpty(sendCc)) {
                mail.addRecipients(Message.RecipientType.CC, sendCc);
            }
            if (UtilValidate.isNotEmpty(sendBcc)) {
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. 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.