com.javactionscript.server
Class ContextualSmtp

java.lang.Object
  extended by com.javactionscript.server.ContextualSmtp

public class ContextualSmtp
extends java.lang.Object

This resource allows to connect to a SMTP server in order to send e-mails.
It can be configured once for all through ContextFactory.getSmtpProperties() and then used during the command execution through the ServiceContext object.
A ContextualSmtp resource can be obtained from a ServiceContext instance.
Requires that the JavaMail library (mail.jar) and the Java Activation Framework library (activation.jar) are accessible from the web application (WEB-INF/lib)


Field Summary
static java.lang.String DEFAULT_CHARSET
          The default character set of the body : ISO-8859-1.
static java.lang.String DEFAULT_CONTENT_TRANSFER_ENCODING
          The default content transfer encoding that will be defined in the e-mail header : 8bit.
static java.lang.String DEFAULT_CONTENT_TYPE
          The default content type that will be defined in the e-mail header : text/plain; charset=UTF-8
 
Method Summary
 void sendEmail(java.lang.String $body, java.lang.String $subject, java.lang.String $from, java.lang.String[] $to, java.lang.String[] $cc, java.lang.String[] $bcc)
          Sends an e-mail using DEFAULT_CHARSET, DEFAULT_CONTENT_TYPE and DEFAULT_CONTENT_TRANSFER_ENCODING.
 void sendEmail(java.lang.String $body, java.lang.String $subject, java.lang.String $from, java.lang.String[] $to, java.lang.String[] $cc, java.lang.String[] $bcc, java.lang.String $charset, java.lang.String $contentType, java.lang.String $contentTransferEncoding)
          Sends an e-mail.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

DEFAULT_CHARSET

public static final java.lang.String DEFAULT_CHARSET
The default character set of the body : ISO-8859-1.

See Also:
Constant Field Values

DEFAULT_CONTENT_TYPE

public static final java.lang.String DEFAULT_CONTENT_TYPE
The default content type that will be defined in the e-mail header : text/plain; charset=UTF-8

See Also:
Constant Field Values

DEFAULT_CONTENT_TRANSFER_ENCODING

public static final java.lang.String DEFAULT_CONTENT_TRANSFER_ENCODING
The default content transfer encoding that will be defined in the e-mail header : 8bit.

See Also:
Constant Field Values
Method Detail

sendEmail

public void sendEmail(java.lang.String $body,
                      java.lang.String $subject,
                      java.lang.String $from,
                      java.lang.String[] $to,
                      java.lang.String[] $cc,
                      java.lang.String[] $bcc)
               throws javax.mail.MessagingException
Sends an e-mail using DEFAULT_CHARSET, DEFAULT_CONTENT_TYPE and DEFAULT_CONTENT_TRANSFER_ENCODING.

Parameters:
$body - The body of the e-mail.
$subject - The subject of the e-mail.
$from - The source e-mail address.
$to - The target e-mail addresses (TO), can be null.
$cc - The target e-mail addresses (CC - carbon copy), can be null.
$bcc - The target e-mail addresses (BCC - blank carbon copy), can be null.
Throws:
javax.mail.MessagingException

sendEmail

public void sendEmail(java.lang.String $body,
                      java.lang.String $subject,
                      java.lang.String $from,
                      java.lang.String[] $to,
                      java.lang.String[] $cc,
                      java.lang.String[] $bcc,
                      java.lang.String $charset,
                      java.lang.String $contentType,
                      java.lang.String $contentTransferEncoding)
               throws javax.mail.MessagingException
Sends an e-mail.

Parameters:
$body - The body of the e-mail.
$subject - The subject of the e-mail.
$from - The source e-mail address.
$to - The target e-mail addresses (TO), can be null.
$cc - The target e-mail addresses (CC - carbon copy), can be null.
$bcc - The target e-mail addresses (BCC - blank carbon copy), can be null.
$charset - The character set of the body.
$contentType - The content type that will be defined in the e-mail header.
$contentTransferEncoding - The content transfer encoding that will be defined in the e-mail header.
Throws:
javax.mail.MessagingException


Copyright 2008 LUNAFELINA - www.javactionscript.com - www.lunafelina.com