com.trackstudio.tools
Class MailWriter

java.lang.Object
  extended by com.trackstudio.tools.MailWriter

public class MailWriter
extends java.lang.Object

This class is used for sending email via JavaMail
Support:

  • sending text/plain and text/html messages
  • sending mail to Recepients from To, CC and BCC fields
  • sending email in various character sets and encodings


    Constructor Summary
    MailWriter(javax.mail.Session s)
              creates new MailWriter by mail session
     
    Method Summary
     void forward(javax.mail.Address[] to, MailImportException ex)
               
     javax.mail.internet.InternetAddress[] getDefaultReplyTo(java.lang.String name)
              returns default FROM address (sets in session properties)
     boolean send(javax.mail.Address from, javax.mail.Address reply, javax.mail.Address[] to, javax.mail.Address[] cc, javax.mail.Address[] bcc, java.lang.String subject, java.lang.String body, java.lang.String charset, java.lang.String encoding, java.lang.String contenttype, int highPriority, java.lang.String xTrackStudio)
              sends email message
     
    Methods inherited from class java.lang.Object
    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
     

    Constructor Detail

    MailWriter

    public MailWriter(javax.mail.Session s)
    creates new MailWriter by mail session

    Method Detail

    getDefaultReplyTo

    public javax.mail.internet.InternetAddress[] getDefaultReplyTo(java.lang.String name)
                                                            throws GranException
    returns default FROM address (sets in session properties)

    Throws:
    GranException

    send

    public boolean send(javax.mail.Address from,
                        javax.mail.Address reply,
                        javax.mail.Address[] to,
                        javax.mail.Address[] cc,
                        javax.mail.Address[] bcc,
                        java.lang.String subject,
                        java.lang.String body,
                        java.lang.String charset,
                        java.lang.String encoding,
                        java.lang.String contenttype,
                        int highPriority,
                        java.lang.String xTrackStudio)
                 throws UserException
    sends email message

    Parameters:
    from - FROM address
    to - Recepients.TO addresses
    cc - Recepients.CC addresses (carbon copy)
    bcc - Recepients.BCC addresses (blind carbon copy)
    subject - Subject of message
    body - Message body
    charset - character set
    encoding - Encoding
    contenttype - Content type (text/plain)
    Throws:
    UserException

    forward

    public void forward(javax.mail.Address[] to,
                        MailImportException ex)
                 throws GranException
    Throws:
    GranException


    Copyright © 2002-2008 TrackStudio, Ltd. All Rights Reserved.