org.deegree.commons.mail
Class MailHelper

java.lang.Object
  extended by org.deegree.commons.mail.MailHelper

public final class MailHelper
extends Object

A helper class to create and send mail.

Version:
$Revision: 30119 $,$Date: 2011-03-22 10:02:35 +0100 (Tue, 22 Mar 2011) $
Author:
Torsten Friebe , last edited by: $Author: aschmitz $
See Also:
Message, MimeMessage

Constructor Summary
MailHelper()
          Creates a mail helper to send a message.
 
Method Summary
 void createAndSendMail(MailMessage eMess, javax.mail.Session session)
          This method creates an email message and sends it using the J2EE mail services
 void createAndSendMail(MailMessage eMess, javax.mail.Session session, File[] files, String[] mimeType)
          This method creates an email message and sends it using the J2EE mail services
 void createAndSendMail(MailMessage eMess, javax.mail.Session session, Object[] attachment, String[] mimeType)
          This method creates an email message and sends it using the J2EE mail services
static void createAndSendMail(MailMessage eMess, String mailHost)
          This method creates an email message and sends it using the J2EE mail services
static void createAndSendMail(MailMessage eMess, String mailHost, File[] files, String[] mimeType)
          This method creates an email message and sends it using the J2EE mail services
static void createAndSendMail(MailMessage eMess, String mailHost, Object[] attachment, String[] mimeType)
          This method creates an email message and sends it using the J2EE mail services
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailHelper

public MailHelper()
Creates a mail helper to send a message.

Method Detail

createAndSendMail

public static void createAndSendMail(MailMessage eMess,
                                     String mailHost)
                              throws SendMailException
This method creates an email message and sends it using the J2EE mail services

Parameters:
eMess - a email message
mailHost - name of the SMTP host
Throws:
SendMailException - an exception if the message is undeliverable

createAndSendMail

public static void createAndSendMail(MailMessage eMess,
                                     String mailHost,
                                     Object[] attachment,
                                     String[] mimeType)
                              throws SendMailException
This method creates an email message and sends it using the J2EE mail services

Parameters:
eMess - a email message
mailHost - name of the SMTP host
attachment - Object to attach to a mail
mimeType - mimetype of the attchment
Throws:
SendMailException

createAndSendMail

public static void createAndSendMail(MailMessage eMess,
                                     String mailHost,
                                     File[] files,
                                     String[] mimeType)
                              throws SendMailException
This method creates an email message and sends it using the J2EE mail services

Parameters:
eMess - a email message
mailHost - name of the SMTP host
files - files to attach to a mail
mimeType - mimetype of the attchment
Throws:
SendMailException

createAndSendMail

public void createAndSendMail(MailMessage eMess,
                              javax.mail.Session session)
                       throws SendMailException
This method creates an email message and sends it using the J2EE mail services

Parameters:
eMess - a email message
session -
Throws:
SendMailException - an exception if the message is undeliverable
See Also:
Transport, J2EE Mail Session connection

createAndSendMail

public void createAndSendMail(MailMessage eMess,
                              javax.mail.Session session,
                              Object[] attachment,
                              String[] mimeType)
                       throws SendMailException
This method creates an email message and sends it using the J2EE mail services

Parameters:
eMess - an email message
session -
attachment - Object to attach to a mail
mimeType - mimetype of the attchment
Throws:
SendMailException - an exception if the message is undeliverable

createAndSendMail

public void createAndSendMail(MailMessage eMess,
                              javax.mail.Session session,
                              File[] files,
                              String[] mimeType)
                       throws SendMailException
This method creates an email message and sends it using the J2EE mail services

Parameters:
eMess - an email message
session -
files - files to attach to a mail
mimeType - mimetype of the attchment
Throws:
SendMailException - an exception if the message is undeliverable


Copyright © 2011. All Rights Reserved.