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

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

Introduction

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

Prototype

public Email setSSLCheckServerIdentity(final boolean sslCheckServerIdentity) 

Source Link

Document

Sets whether the server identity is checked as specified by RFC 2595

Usage

From source file:eu.ggnet.dwoss.mandator.api.value.Mandator.java

/**
 * Prepares a eMail to be send direct over the mandator smtp configuration.
 * The email is missing: to, subject, message and optional attachments.
 *
 * @return the email// w w w .  j  a v  a  2  s  . c  om
 * @throws EmailException if something is wrong in the subsystem.
 */
public MultiPartEmail prepareDirectMail() throws EmailException {
    MultiPartEmail email = new MultiPartEmail();
    email.setHostName(smtpConfiguration.getHostname());
    email.addBcc(company.getEmail());
    email.setFrom(company.getEmail(), company.getEmailName());
    email.setAuthentication(smtpConfiguration.getSmtpAuthenticationUser(),
            smtpConfiguration.getSmtpAuthenticationPass());
    email.setStartTLSEnabled(false);
    email.setSSLCheckServerIdentity(false);
    email.setSSLOnConnect(false);
    email.setCharset(smtpConfiguration.getCharset());
    return email;
}