votorola.g.mail
Class MailSender

java.lang.Object
  extended by MailSender

@ThreadRestricted
public final class MailSender
extends Object

A sender of messages, with access to an SMTP mail transfer service.


Constructor Summary
MailSender(SMTPTransportX.ConfigurationContext cc)
          Constructs a MailSender.
 
Method Summary
 boolean isDryRun()
          Returns true if this mail sender is to run without actually sending any mail; while doing everything else, as far as possible.
 void setDryRun(boolean newDryRun)
          Sets whether the mail sender is to run without actually sending any mail.
 Exception trySend(Message message, Session session)
          Attempts to send a message.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailSender

public MailSender(SMTPTransportX.ConfigurationContext cc)
           throws MisconfigurationException
Constructs a MailSender.

Throws:
MisconfigurationException
Method Detail

isDryRun

public boolean isDryRun()
Returns true if this mail sender is to run without actually sending any mail; while doing everything else, as far as possible.

See Also:
setDryRun(boolean)

setDryRun

public final void setDryRun(boolean newDryRun)
Sets whether the mail sender is to run without actually sending any mail. The default value is false; mail will actually be sent.

See Also:
isDryRun()

trySend

public Exception trySend(Message message,
                         Session session)
Attempts to send a message. Returns any exception that occured, as a result of the attempt.

Returns:
any exception that occured; or null, if the attempt succeeded