fr.paris.lutece.portal.service.mail
Class MailService

java.lang.Object
  extended by fr.paris.lutece.portal.service.mail.MailService

public final class MailService
extends java.lang.Object

Application Mail Service


Method Summary
static java.lang.String getNoReplyEmail()
          Returns a no reply email address defined in config.properties
static IMailQueue getQueue()
          Returns the mail queue
static void sendMail(java.lang.String strRecipient, java.lang.String strSenderName, java.lang.String strSenderEmail, java.lang.String strSubject, java.lang.String strMessage)
          Send a message asynchronously.
static void sendMail(java.lang.String strRecipient, java.lang.String strSenderName, java.lang.String strSenderEmail, java.lang.String strSubject, java.lang.String strMessage, java.util.Map mapAttachments)
          Send a message asynchronously.
static void shutdown()
          Shutdown the service
static void transferQueueMails(java.lang.String strHost, java.lang.StringBuffer sbLogs)
          Send all messages store in the queue to the smtp server
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

sendMail

public static void sendMail(java.lang.String strRecipient,
                            java.lang.String strSenderName,
                            java.lang.String strSenderEmail,
                            java.lang.String strSubject,
                            java.lang.String strMessage)
Send a message asynchronously. The message is queued until a daemon thread send all awaiting messages

Parameters:
strRecipient - The recipient email.
strSenderName - The sender name.
strSenderEmail - The sender email address.
strSubject - The message subject.
strMessage - The message.

sendMail

public static void sendMail(java.lang.String strRecipient,
                            java.lang.String strSenderName,
                            java.lang.String strSenderEmail,
                            java.lang.String strSubject,
                            java.lang.String strMessage,
                            java.util.Map mapAttachments)
Send a message asynchronously. The message is queued until a daemon thread send all awaiting messages

Parameters:
strRecipient - The recipient email.
strSenderName - The sender name.
strSenderEmail - The sender email address.
strSubject - The message subject.
strMessage - The message.
mapAttachments - The map containing the attachments associated with their content-location.

shutdown

public static void shutdown()
Shutdown the service


getNoReplyEmail

public static java.lang.String getNoReplyEmail()
Returns a no reply email address defined in config.properties

Returns:
A no reply email

getQueue

public static IMailQueue getQueue()
Returns the mail queue

Returns:
the mail queue

transferQueueMails

public static void transferQueueMails(java.lang.String strHost,
                                      java.lang.StringBuffer sbLogs)
Send all messages store in the queue to the smtp server

Parameters:
strHost - The SMTP name or IP address.
sbLogs - the string buffer use for loging all send Message.


Copyright © 2008 Mairie de Paris. All Rights Reserved.