com.cysols.iodef.transport
Class MailTransporter

java.lang.Object
  extended by com.cysols.iodef.transport.MailTransporter

public class MailTransporter
extends Object

This class is used to transport an IODEF xml file through SMTP.


Constructor Summary
MailTransporter(String smtpServer)
          A default constructor with SMTP Server.
 
Method Summary
 void send(String from, String[] to, String subject, String body, File xmlFile)
          Sends a Email with attaching a xml file.
 void send(String from, String[] to, String subject, String body, String xmlFilePath)
          Sends a Email with attaching a xml file.
 void send(String from, String[] to, String subject, String body, String reply, String returnPath, File xmlFile)
          Sends a Email with attaching a xml file.
 void send(String from, String[] to, String subject, String body, String reply, String returnPath, String xmlFilePath)
          Sends a Email with attaching a xml file.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailTransporter

public MailTransporter(String smtpServer)
                throws AddressException
A default constructor with SMTP Server. The specified SMTP Server is used to send a mail with XML file.

Throws:
AddressException - - a wrongly formatted address is given.
Method Detail

send

public void send(String from,
                 String[] to,
                 String subject,
                 String body,
                 String xmlFilePath)
          throws UnsupportedEncodingException,
                 MessagingException
Sends a Email with attaching a xml file.

Parameters:
from - Mail Sender Address.
to - an array of Mail Recipient addresses.
subject - Mail Subject
body - Mail Contents
xmlFilePath - IODEF xml file path.
Throws:
UnsupportedEncodingException - the charactor encoding is not supported.
MessagingException - thrown while mail sending.

send

public void send(String from,
                 String[] to,
                 String subject,
                 String body,
                 File xmlFile)
          throws UnsupportedEncodingException,
                 MessagingException
Sends a Email with attaching a xml file.

Parameters:
from - Mail Sender Address.
to - an array of Mail Recipient addresses.
subject - Mail Subject
body - Mail Contents
xmlFile - xmlFile instance.
Throws:
UnsupportedEncodingException - the charactor encoding is not supported.
MessagingException - thrown while mail sending.

send

public void send(String from,
                 String[] to,
                 String subject,
                 String body,
                 String reply,
                 String returnPath,
                 String xmlFilePath)
          throws UnsupportedEncodingException,
                 MessagingException
Sends a Email with attaching a xml file.

Parameters:
from - Mail Sender Address.
to - an array of Mail Recipient addresses.
subject - Mail Subject
body - Mail Contents
reply - Replay Address in the mail header
returnPath - Return-Path address in the mail header
xmlFilePath - IODEF xml file path.
Throws:
UnsupportedEncodingException - the charactor encoding is not supported.
MessagingException - thrown while mail sending.

send

public void send(String from,
                 String[] to,
                 String subject,
                 String body,
                 String reply,
                 String returnPath,
                 File xmlFile)
          throws UnsupportedEncodingException,
                 MessagingException
Sends a Email with attaching a xml file.

Parameters:
from - Mail Sender Address.
to - an array of Mail Recipient addresses.
subject - Mail Subject
body - Mail Contents
reply - Replay Address in the mail header
returnPath - Return-Path address in the mail header
xmlFile - xmlFile instance.
Throws:
UnsupportedEncodingException - the charactor encoding is not supported.
MessagingException - thrown while mail sending.