List of usage examples for org.apache.commons.mail Email addBcc
public Email addBcc(final String email, final String name) throws EmailException
From source file:org.ploin.pmf.impl.MailSender.java
private void setMailProperties(Email email, MailConfig mailConfig) throws MailFactoryException { try {/*from w w w . j a v a 2 s . c o m*/ email.setSubject(mailConfig.getSubject()); for (Recipient toRecipient : mailConfig.getToRecipients()) { if (toRecipient.getName() != null) { email.addTo(toRecipient.getEmail(), toRecipient.getName()); } else { email.addTo(toRecipient.getEmail()); } } if (!mailConfig.isCcRecipientEmpty()) { for (Recipient ccRecipient : mailConfig.getCcRecipients()) { if (ccRecipient.getName() != null) { email.addCc(ccRecipient.getEmail(), ccRecipient.getName()); } else { email.addCc(ccRecipient.getEmail()); } } } if (!mailConfig.isBccRecipientEmpty()) { for (Recipient bccRecipient : mailConfig.getBccRecipients()) { if (bccRecipient.getName() != null) { email.addBcc(bccRecipient.getEmail(), bccRecipient.getName()); } else { email.addBcc(bccRecipient.getEmail()); } } } } catch (Exception e) { throw new MailFactoryException(e); } }