org.kuali.rice.core.mail
Class MailerImpl

java.lang.Object
  extended by org.kuali.rice.core.mail.MailerImpl
All Implemented Interfaces:
Mailer

public class MailerImpl
extends Object
implements Mailer

Maintains a Java Mail session and is used for sending e-mails.

Author:
Kuali Rice Team (rice.collab@kuali.org)

Field Summary
protected  org.apache.log4j.Logger LOG
           
 
Constructor Summary
MailerImpl()
           
 
Method Summary
protected  void prepareHtmlMessage(String messageText, javax.mail.Message message)
           
 void sendEmail(EmailFrom from, EmailTo to, EmailSubject subject, EmailBody body, boolean htmlMessage)
          Send an email to a single recipient with the specified subject and message.
 void sendEmail(EmailFrom from, EmailToList to, EmailSubject subject, EmailBody body, EmailCcList cc, EmailBcList bc, boolean htmlMessage)
          Send an email to the given "to", "cc", and "bcc" recipients with the specified subject and message.
 void sendEmail(MailMessage message)
          Construct and a send simple email message from a Mail Message.
protected  void sendMessage(String from, javax.mail.Address[] to, String subject, String messageBody, javax.mail.Address[] cc, javax.mail.Address[] bcc, boolean htmlMessage)
          Send an email to the given recipients with the specified subject and message.
 void setMailSender(org.springframework.mail.javamail.JavaMailSenderImpl mailSender)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

LOG

protected final org.apache.log4j.Logger LOG
Constructor Detail

MailerImpl

public MailerImpl()
Method Detail

setMailSender

public void setMailSender(org.springframework.mail.javamail.JavaMailSenderImpl mailSender)
Parameters:
mailSender - The injected Mail Sender.

sendEmail

public void sendEmail(MailMessage message)
               throws javax.mail.MessagingException
Construct and a send simple email message from a Mail Message.

Specified by:
sendEmail in interface Mailer
Parameters:
message - the Mail Message
Throws:
javax.mail.MessagingException

sendEmail

public void sendEmail(EmailFrom from,
                      EmailTo to,
                      EmailSubject subject,
                      EmailBody body,
                      boolean htmlMessage)
Send an email to a single recipient with the specified subject and message. This is a convenience method for simple message addressing.

Specified by:
sendEmail in interface Mailer
Parameters:
from - sender of the message
to - list of addresses to which the message is sent
subject - subject of the message
body - body of the message

sendEmail

public void sendEmail(EmailFrom from,
                      EmailToList to,
                      EmailSubject subject,
                      EmailBody body,
                      EmailCcList cc,
                      EmailBcList bc,
                      boolean htmlMessage)
Send an email to the given "to", "cc", and "bcc" recipients with the specified subject and message.

Specified by:
sendEmail in interface Mailer
Parameters:
from - sender of the message
to - list of addresses to which the message is sent
subject - subject of the message
body - body of the message
cc - list of addresses which are to be cc'd on the message
bc - list of addresses which are to be bcc'd on the message

sendMessage

protected void sendMessage(String from,
                           javax.mail.Address[] to,
                           String subject,
                           String messageBody,
                           javax.mail.Address[] cc,
                           javax.mail.Address[] bcc,
                           boolean htmlMessage)
                    throws javax.mail.internet.AddressException,
                           javax.mail.MessagingException,
                           org.springframework.mail.MailException
Send an email to the given recipients with the specified subject and message.

Parameters:
from - sender of the message
to - list of addresses to which the message is sent
subject - subject of the message
messageBody - body of the message
cc - list of addresses which are to be cc'd on the message
bcc - list of addresses which are to be bcc'd on the message
Throws:
javax.mail.internet.AddressException
javax.mail.MessagingException
org.springframework.mail.MailException

prepareHtmlMessage

protected void prepareHtmlMessage(String messageText,
                                  javax.mail.Message message)
                           throws javax.mail.MessagingException
Throws:
javax.mail.MessagingException


Copyright © 2005-2014 The Kuali Foundation. All Rights Reserved.