com.norconex.jef.mail
Class SimpleMailer

java.lang.Object
  extended by com.norconex.jef.mail.SimpleMailer

public class SimpleMailer
extends Object

Convenience class for sending simple emails. It does not cover most advanced needs (HTML images, attachments, etc).

Author:
Pascal Essiembre

Constructor Summary
SimpleMailer(String host, String sender)
          Constructor.
SimpleMailer(String host, String sender, String contentType)
          Constructor.
SimpleMailer(String host, String sender, String[] recipients)
          Constructor.
SimpleMailer(String host, String sender, String[] recipients, String contentType)
          Constructor.
 
Method Summary
 void send(String[] recipients, String subject, String body)
          Sends an email.
 void send(String subject, String body)
          Sends an email.
 void send(String recipient, String subject, String body)
          Sends an email.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SimpleMailer

public SimpleMailer(String host,
                    String sender)
Constructor.

Parameters:
host - mail server host
sender - email address of sender ("From" field)

SimpleMailer

public SimpleMailer(String host,
                    String sender,
                    String[] recipients)
Constructor.

Parameters:
host - mail server host
sender - email address of sender ("From" field)
recipients - email address of recipients ("To" field)

SimpleMailer

public SimpleMailer(String host,
                    String sender,
                    String contentType)
Constructor.

Parameters:
host - mail server host
sender - email address of sender ("From" field)
contentType - content type of the email message

SimpleMailer

public SimpleMailer(String host,
                    String sender,
                    String[] recipients,
                    String contentType)
Constructor.

Parameters:
host - mail server host
sender - email address of sender ("From" field)
recipients - email address of recipients ("To" field)
contentType - content type of the email message
Method Detail

send

public final void send(String subject,
                       String body)
                throws javax.mail.MessagingException
Sends an email.

Parameters:
subject - email subject
body - email body (content)
Throws:
javax.mail.MessagingException - problem sending email

send

public final void send(String recipient,
                       String subject,
                       String body)
                throws javax.mail.MessagingException
Sends an email.

Parameters:
recipient - email recipient ("To" field)
subject - email subject
body - email body (content)
Throws:
javax.mail.MessagingException - problem sending email

send

public final void send(String[] recipients,
                       String subject,
                       String body)
                throws javax.mail.MessagingException
Sends an email.

Parameters:
recipients - email recipients ("To" field)
subject - email subject
body - email body (content)
Throws:
javax.mail.MessagingException - problem sending email


Copyright © 2007-2013 Norconex Inc.. All Rights Reserved.