com.jfw.mail
Class SendEmailThread

java.lang.Object
  extended by com.jfw.mail.SendEmailThread
All Implemented Interfaces:
java.lang.Runnable

public final class SendEmailThread
extends java.lang.Object
implements java.lang.Runnable

Used for send an email.
For asynchronously send use method send().
For synchronously send use method run().

Example

   SendEmailThread sendEmailThread = new SendEmailThread(...);
   sendEmailThread.send();
 


Constructor Summary
SendEmailThread(java.lang.String host, java.lang.String username, java.lang.String password, java.lang.String from, java.util.ArrayList to, java.util.ArrayList cc, java.util.ArrayList bcc, java.lang.String object, java.lang.String text, java.lang.String subcontentType, java.lang.String charsetEncoding, java.lang.String port, boolean isSecure, boolean isDebug)
          Create a new instance.
 
Method Summary
 void run()
          Use this methiod directly for send the email synchronously.
 void send()
          Create a new thread and use it for send the mail.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SendEmailThread

public SendEmailThread(java.lang.String host,
                       java.lang.String username,
                       java.lang.String password,
                       java.lang.String from,
                       java.util.ArrayList to,
                       java.util.ArrayList cc,
                       java.util.ArrayList bcc,
                       java.lang.String object,
                       java.lang.String text,
                       java.lang.String subcontentType,
                       java.lang.String charsetEncoding,
                       java.lang.String port,
                       boolean isSecure,
                       boolean isDebug)
                throws java.lang.Exception
Create a new instance.

Parameters:
from - mail address of sender.
username - username. If null mail server authentication parameters will not be set.
password - password. If null mail server authentication parameters will not be set.
to - mail addresses of receivers.
cc - mail addresses of Cc.
bcc - mail addresses of Bcc.
object - mail object.
text - mail text.
subcontentType - content type of mail.
charsetEncoding - charset encoding to use.
port - the port of the mail server.
isSecure - set email secure mode (SSL).
isDebug - set email send debug mode.
Throws:
java.lang.Exception
Method Detail

send

public void send()
Create a new thread and use it for send the mail.


run

public void run()
Use this methiod directly for send the email synchronously.

Specified by:
run in interface java.lang.Runnable