/*
* DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS HEADER.
*
* Copyright (c) 2005 Sun Microsystems Inc. All Rights Reserved
*
* The contents of this file are subject to the terms
* of the Common Development and Distribution License
* (the License). You may not use this file except in
* compliance with the License.
*
* You can obtain a copy of the License at
* See the License for the specific language governing
* permission and limitations under the License.
*
* When distributing Covered Code, include this CDDL
* Header Notice in each file and include the License file
* at opensso/legal/CDDLv1.0.txt.
* If applicable, add the following below the CDDL Header,
* with the fields enclosed by brackets [] replaced by
* your own identifying information:
* "Portions Copyrighted [year] [name of copyright owner]"
*
* $Id: AMSendMail.java,v 1.6 2009/12/22 19:57:19 qcheng Exp $
*
* Portions Copyrighted 2011-2015 ForgeRock AS.
*/
/*
* This is a send mail utility class which can be used to send notifications to
* the users if some event occurs.
*/
public class AMSendMail {
/**
* Constructor that grabs its SMTP values from SystemProperties.
*/
public AMSendMail() {
}
/**
* Posts e-mail messages to users. This method will wait on for the timeouts
* when the specified host is down. Use this method in a separate thread so
* that it will not hang when the mail server is down.
*
* @param recipients A String array of e-mail addresses to be sent to
* @param subject The e-mail subject
* @param message The content contained in the e-mail
* @param from The sending e-mail address
* @param charset The charset used in e-mail encoding
* @exception MessagingException if there is any error in sending e-mail
*/
}
/**
* Posts e-mail messages to users. This method will wait on for the timeouts
* when the specified host is down. Use this method in a separate thread so
* that it will not hang when the mail server is down.
*
* @param recipients A String array of e-mail addresses to be sent to
* @param subject The e-mail subject
* @param message The content contained in the e-mail
* @param from The sending e-mail address
* @exception MessagingException if there is any error in sending e-mail
*/
}
/**
* Posts e-mail messages to users. This method will wait on for the timeouts
* when the specified host is down. Use this method in a separate thread so
* that it will not hang when the mail server is down.
*
* @param recipients A String array of e-mail addresses to be sent to
* @param subject The e-mail subject
* @param message The content contained in the e-mail
* @param from The sending e-mail address
* @param mimeType The MIME type of the e-mail
* @param charset The charset used in e-mail encoding
* @exception MessagingException if there is any error in sending e-mail
*/
boolean debug = false;
// create some properties and get the default mail Session
// create a message object
// set the from and to address
}
// Setting the Subject and Content Type
} else {
}
// Transport the message now
}
/**
* Posts e-mail messages to users. This method will wait on for the timeouts
* when the specified host is down. Use this method in a separate thread so
* that it will not hang when the mail server is down.
*
* @param recipients A String array of e-mail addresses to be sent to
* @param subject The e-mail subject
* @param message The content contained in the e-mail
* @param from The sending e-mail address
* @param charset The charset used in e-mail encoding
* @param host The host name to connect to send e-mail
* @param port The host port to connect to send e-mail
* @param user The user name used to authenticate to the host
* @param password The user password used to authenticate to the host
* @param ssl A boolean to indicate whether SSL is needed to connect to the host
* @exception MessagingException if there is any error in sending e-mail
*/
throws MessagingException {
postMail(recipients, subject, message, from, "text/plain", charset, host, port, user, password, ssl);
}
/**
* Posts e-mail messages to users. This method will wait on for the timeouts
* when the specified host is down. Use this method in a separate thread so
* that it will not hang when the mail server is down.
*
* @param recipients A String array of e-mail addresses to be sent to
* @param subject The e-mail subject
* @param message The content contained in the e-mail
* @param from The sending e-mail address
* @param mimeType The MIME type of the e-mail
* @param charset The charset used in e-mail encoding
* @param host The host name to connect to send e-mail
* @param port The host port to connect to send e-mail
* @param user The user name used to authenticate to the host
* @param password The user password used to authenticate to the host
* @param ssl A boolean to indicate whether SSL is needed to connect to the host
* @exception MessagingException if there is any error in sending e-mail
*/
throws MessagingException {
boolean debug = false;
if (ssl) {
"javax.net.ssl.SSLSocketFactory");
}
// create some properties and get the mail Session
} else {
}
// create a message object
// set the from and to address
}
// Setting the Subject and Content Type
} else {
}
// Transport the message now
}
}