Example usage for org.apache.commons.mail MultiPartEmail setCc

List of usage examples for org.apache.commons.mail MultiPartEmail setCc

Introduction

In this page you can find the example usage for org.apache.commons.mail MultiPartEmail setCc.

Prototype

public Email setCc(final Collection<InternetAddress> aCollection) throws EmailException 

Source Link

Document

Set a list of "CC" addresses.

Usage

From source file:org.kantega.respiro.mail.ServerConfig.java

public MultiPartEmail newMail() {
    MultiPartEmail mail = new MultiPartEmail();

    mail.setHostName(host);// www .ja va  2  s .com
    if (!ssl)
        mail.setSmtpPort(port);
    else
        mail.setSslSmtpPort(valueOf(port));
    if (username != null && password != null)
        mail.setAuthentication(username, password);

    try {
        if (!to.isEmpty())
            mail.setTo(to);
        if (!cc.isEmpty())
            mail.setCc(cc);
        if (!bcc.isEmpty())
            mail.setBcc(bcc);
        if (fromMail != null)
            mail.setFrom(fromMail);
    } catch (EmailException e) {
        throw new RuntimeException(e);
    }

    return mail;
}