| java.lang.Object edu.iu.uis.eden.mail.Mailer
Mailer | public class Mailer (Code) | | Maintains a Java Mail session and can be used for sending emails.
author: ewestfal |
Field Summary | |
final protected org.apache.log4j.Logger | LOG |
Constructor Summary | |
public | Mailer(Properties configProperties, Authenticator authenticator) Create a AuthenticatedMailer with the default values for authenticated
use of mail-relay.iu.edu. | public | Mailer(Properties configProperties) | public | Mailer(Properties configProperties, String username, String password) |
Method Summary | |
public Authenticator | getAuthenticator() | public Properties | getConfig() | public Session | getCurrentSession() This allows direct access to the Mail Session. | public void | sendMessage(String sender, Address[] recipients, String subject, String messageBody, Address[] ccRecipients, Address[] bccRecipients, boolean htmlMessage) Sends an email to the given recipients. | public void | sendMessage(String sender, String recipient, String subject, String messageBody, boolean htmlMessage) Send a message to the designated recipient with the specified subject and
message. | public void | setConfig(Properties configProperties) A method to configure the Mailer properties. |
LOG | final protected org.apache.log4j.Logger LOG(Code) | | |
Mailer | public Mailer(Properties configProperties, Authenticator authenticator)(Code) | | Create a AuthenticatedMailer with the default values for authenticated
use of mail-relay.iu.edu.
The Kerberos principle and and password should be a system principle
rather than a user principle.
Parameters: senderAddress - return address for the mail being sent Parameters: kbPrincipleName - kerberos principle name used to authenticate to mail-relay Parameters: kbPrinciplePassword - kerberos principle password used to authenticate to mail-relay |
getAuthenticator | public Authenticator getAuthenticator()(Code) | | |
getConfig | public Properties getConfig()(Code) | | current properties used to configure the mail session |
getCurrentSession | public Session getCurrentSession() throws NoSuchProviderException(Code) | | This allows direct access to the Mail Session. While this offers more
flexibility, the AuthenticatedMailer will no longer be responsible for
management of the this session.
get the current session. If current session is null it creates anew one. |
sendMessage | public void sendMessage(String sender, Address[] recipients, String subject, String messageBody, Address[] ccRecipients, Address[] bccRecipients, boolean htmlMessage) throws AddressException, MessagingException(Code) | | Sends an email to the given recipients.
Parameters: recipients - list of addresses to which the message is sent Parameters: subject - subject of the message Parameters: messageBody - body of the message Parameters: ccRecipients - list of addresses which are to be cc'd on the message Parameters: bccRecipients - list of addresses which are to be bcc'd on the message throws: AddressException - throws: MessagingException - |
sendMessage | public void sendMessage(String sender, String recipient, String subject, String messageBody, boolean htmlMessage) throws AddressException, MessagingException(Code) | | Send a message to the designated recipient with the specified subject and
message. This is a convience class for simple message addressing
Parameters: recipient - the email address to which the message is sent Parameters: subject - subject for the message Parameters: messageBody - body of the message to to be sent Parameters: ccRecipient - email address of a cc recipient |
setConfig | public void setConfig(Properties configProperties)(Code) | | A method to configure the Mailer properties. This class will default to a
set of properties but this method allows the calling program to set the
specific properties.
Parameters: mailConfigProperties - Proeprties object containing configuration information |
|
|