ccc.plugins.mail.javamail
Class JavaMailMailer

java.lang.Object
  extended by javax.mail.Authenticator
      extended by ccc.plugins.mail.javamail.JavaMailMailer
All Implemented Interfaces:
Mailer

public class JavaMailMailer
extends javax.mail.Authenticator
implements Mailer

JavaMail implementation of the Mailer interface.

Author:
Civic Computing Ltd.

Field Summary
 
Fields inherited from interface ccc.plugins.mail.Mailer
NAME
 
Constructor Summary
JavaMailMailer(javax.mail.Session session)
          Constructor.
 
Method Summary
 boolean send(EmailAddress toAddress, EmailAddress fromAddress, java.lang.String subject, java.lang.String message)
          Sends a plain text message to the specified recipient.
 void setDebug(boolean debug)
          Enable debugging for this mailer.
 
Methods inherited from class javax.mail.Authenticator
getDefaultUserName, getPasswordAuthentication, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingSite
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JavaMailMailer

public JavaMailMailer(javax.mail.Session session)
Constructor.

Parameters:
session - The JavaMail session to use.
Method Detail

send

public boolean send(EmailAddress toAddress,
                    EmailAddress fromAddress,
                    java.lang.String subject,
                    java.lang.String message)
Sends a plain text message to the specified recipient.

Specified by:
send in interface Mailer
Parameters:
toAddress - The address to which the email will be sent.
fromAddress - The address from which the email will be sent.
subject - The email's subject.
message - The email's body.
Returns:
True if the mail was sent successfully, false otherwise.

setDebug

public void setDebug(boolean debug)
Enable debugging for this mailer.

Parameters:
debug - True if debugging should be enabled; false otherwise.


Copyright © 2010. All Rights Reserved.