asgaard.utils.mail
Class FixedMsgSend

java.lang.Object
  |
  +--java.lang.Thread
        |
        +--asgaard.utils.mail.FixedMsgSend

public class FixedMsgSend
extends java.lang.Thread

Modified demo-app that shows how to construct and send an RFC822 (singlepart) message.


Field Summary
protected  java.lang.String cc
           
protected  java.lang.String charset
           
protected  boolean debug
          Turns the mailer into debug - mode, displays msg on System.out
protected  java.lang.String from
           
protected  java.lang.String mailer
           
protected  java.lang.String mailhost
           
protected  java.util.Vector queue
           
protected  java.lang.String to
           
 
Fields inherited from class java.lang.Thread
MAX_PRIORITY, MIN_PRIORITY, NORM_PRIORITY
 
Constructor Summary
FixedMsgSend(java.lang.String to, java.lang.String from, java.lang.String cc, java.lang.String mailhost)
          Creates a new fixed mailer (only subject and message may varie).
FixedMsgSend(java.lang.String to, java.lang.String from, java.lang.String cc, java.lang.String mailhost, boolean start)
          Creates a new fixed mailer (only subject and message may varie).
 
Method Summary
 void newMsg(java.lang.String subject, java.lang.String messagebody)
          Sends a Message to the specified target.
 void run()
          Does the spooling when the mailer has been started
 void setDebugMode(boolean on)
           
 void setMimeCharset(java.lang.String mime)
           
 void spoolMsg(java.lang.String to, java.lang.String subject, java.lang.String messagebody)
          Sends a Message to the specified target, using the spooler (if the thread is running).
 
Methods inherited from class java.lang.Thread
activeCount, checkAccess, countStackFrames, currentThread, destroy, dumpStack, enumerate, getContextClassLoader, getName, getPriority, getThreadGroup, interrupt, interrupted, isAlive, isDaemon, isInterrupted, join, join, join, resume, setContextClassLoader, setDaemon, setName, setPriority, sleep, sleep, start, stop, stop, suspend, toString, yield
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

to

protected java.lang.String to

from

protected final java.lang.String from

cc

protected final java.lang.String cc

mailhost

protected final java.lang.String mailhost

queue

protected java.util.Vector queue

debug

protected boolean debug
Turns the mailer into debug - mode, displays msg on System.out

charset

protected java.lang.String charset

mailer

protected final java.lang.String mailer
Constructor Detail

FixedMsgSend

public FixedMsgSend(java.lang.String to,
                    java.lang.String from,
                    java.lang.String cc,
                    java.lang.String mailhost)
Creates a new fixed mailer (only subject and message may varie).
Parameters:
to - mailto - eMailadress
from - eMailadress
cc - carbon copy (optional)
mailhost - assumption: mail.smtp.host

FixedMsgSend

public FixedMsgSend(java.lang.String to,
                    java.lang.String from,
                    java.lang.String cc,
                    java.lang.String mailhost,
                    boolean start)
Creates a new fixed mailer (only subject and message may varie).
Parameters:
to - mailto - eMailadress
from - eMailadress
cc - carbon copy (optional)
mailhost - assumption: mail.smtp.host
start - starts the thread
Method Detail

setDebugMode

public void setDebugMode(boolean on)

setMimeCharset

public void setMimeCharset(java.lang.String mime)

spoolMsg

public void spoolMsg(java.lang.String to,
                     java.lang.String subject,
                     java.lang.String messagebody)
Sends a Message to the specified target, using the spooler (if the thread is running).

newMsg

public void newMsg(java.lang.String subject,
                   java.lang.String messagebody)
Sends a Message to the specified target.

run

public void run()
Does the spooling when the mailer has been started
Overrides:
run in class java.lang.Thread