MailService.java :  » Portal » jportlet » net » sf » jportlet » service » mail » Java Open Source

Java Open Source » Portal » jportlet 
jportlet » net » sf » jportlet » service » mail » MailService.java
/*
 * Created on May 11, 2003
 */
package net.sf.jportlet.service.mail;

import javax.mail.Address;
import javax.mail.MessagingException;

import javax.naming.NamingException;

import net.sf.jportlet.service.PortletService;


/**
 * The <code>MailService</code> sends emails.
 * This service expects the following properties:
 * <ul>
 *      <li>session: JNDI of the <code>javax.mail.Session</code>
 * </ul>
 * @author <a href="mailto:tchbansi@sourceforge.net">Herve Tchepannou</a>
 */
public interface MailService
    extends PortletService
{
    //~ Static fields/initializers ---------------------------------------------

    public static final String NAME = MailService.class.getName(  );
    public static final String MIME_HTML = "text/html";
    public static final String MIME_TEXT = "text/plain";

    //~ Methods ----------------------------------------------------------------

    /**
     * Send an email
     * @throws NamingException if the JNDINAme of the <code>javax.mail.Session</code> is invalid
     * @throws MessagingException if any error while sending the email
     */
    public void send( Address  from,
                      Address  to[],
                      String   subject,
                      String   body,
                      String   mimeType )
        throws NamingException, 
                   MessagingException;
}
java2s.com  | Contact Us | Privacy Policy
Copyright 2009 - 12 Demo Source and Support. All rights reserved.
All other trademarks are property of their respective owners.