org.sape.carbon.services.email
Interface MailService

All Superinterfaces:
FunctionalInterface
All Known Implementing Classes:
SynchronousMailService

public interface MailService
extends FunctionalInterface

The MailService Interface provides methods for sending text and html mails with or without attachments.

Copyright 2002 Sapient

Since:
carbon 1.0
Version:
$Revision: 1.4 $
Author:
$Author: dvoet $ $Date: 2003/05/05 21:21:29 $

Method Summary
 void sendMail(MailDataObject mailDataObject)
          Sends an email with the parameters specified in mail data object.
 

Method Detail

sendMail

public void sendMail(MailDataObject mailDataObject)
              throws MailFailureException

Sends an email with the parameters specified in mail data object. E.x MailDataObject mailDataObject = new MailDataObject(); mailDataObject.addTo("someone@somewhere.com", "someone"); mailDataObject.setFrom("ejfw4@sapient.com", "ejfw4"); mailDataObject.setSubject("Hello"); mailDataObject.setBody("A simple plain text email", MailContentTypeEnum.PLAIN_TEXT); // Fetch the mail component MailService mailService = (MailService) Lookup.getInstance(). fetchComponent("/email/test/testEmail"); mailService.sendMail(mailDataObject);

Parameters:
mailDataObject - Encapsulates all the parameters required to send a mail.
Throws:
MailFailureException - Thrown if unable to send the mail.


Copyright 1999-2003 Sapient Corporation. All Rights Reserved.