com.github.jknack.mwa.mail
Class MailModule

java.lang.Object
  extended by com.github.jknack.mwa.mail.MailModule

@Configuration
public class MailModule
extends Object

Provide common mail features.

Since:
0.1.3
Author:
edgar.espina
See Also:
MailBuilder

Field Summary
static String MAIL_PASSWORD
          Set the password for the account at the mail host, if any.
static String MAIL_USER
          Set the username for the account at the mail host, if any.
static String SMTP_ALLOW_8BIT_MIME
          If set to true, and the server supports the 8BITMIME extension, text parts of this message that use the "quoted-printable" or "base64" encodings are converted to use "8bit" encoding if they follow the RFC 2045 rules for 8bit text.
static String SMTP_AUTH
          Use SMTP-AUTH to authenticate to SMTP server.
static String SMTP_DSN_NOTIFY
          Set notification options to be used if the server supports Delivery Status Notification (RFC 1891).
static String SMTP_DSN_RET
          Set return option to be used if server supports Delivery Status Notification (RFC 1891).
static String SMTP_ENVELOP_FROM
          Set the From address to appear in the SMTP envelope.
static String SMTP_HOST
          Set the mail server host, typically an SMTP host.
static String SMTP_PORT
          Set the mail server port.
static String SMTP_SENDPARTIAL
          If set to true, and this message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException.
static String SMTP_START_TLS
          Use TLS to encrypt communication with SMTP server.
 
Constructor Summary
MailModule()
           
 
Method Summary
 org.springframework.mail.javamail.JavaMailSender javaMailSender(org.springframework.core.env.Environment environment)
          Publish a JavaMailSender into the application context.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SMTP_SENDPARTIAL

public static final String SMTP_SENDPARTIAL
If set to true, and this message has some valid and some invalid addresses, send the message anyway, reporting the partial failure with a SendFailedException. If set to true (the default). If true, overrides the mail.smtp.sendpartial property.

See Also:
Constant Field Values

SMTP_ENVELOP_FROM

public static final String SMTP_ENVELOP_FROM
Set the From address to appear in the SMTP envelope. Note that this is different than the From address that appears in the message itself. The envelope From address is typically used when reporting errors. See RFC 821 for details. If set, overrides the mail.smtp.from property.

See Also:
Constant Field Values

SMTP_HOST

public static final String SMTP_HOST
Set the mail server host, typically an SMTP host. Required.

See Also:
Constant Field Values

SMTP_PORT

public static final String SMTP_PORT
Set the mail server port. Default is: 25.

See Also:
Constant Field Values

SMTP_DSN_NOTIFY

public static final String SMTP_DSN_NOTIFY
Set notification options to be used if the server supports Delivery Status Notification (RFC 1891). Either NOTIFY_NEVER or some combination of NOTIFY_SUCCESS, NOTIFY_FAILURE, and NOTIFY_DELAY. If set, overrides the mail.smtp.dsn.notify property.

See Also:
Constant Field Values

SMTP_DSN_RET

public static final String SMTP_DSN_RET
Set return option to be used if server supports Delivery Status Notification (RFC 1891). Either RETURN_FULL or RETURN_HDRS.

If set, overrides the mail.smtp.dsn.ret property.

See Also:
Constant Field Values

SMTP_ALLOW_8BIT_MIME

public static final String SMTP_ALLOW_8BIT_MIME
If set to true, and the server supports the 8BITMIME extension, text parts of this message that use the "quoted-printable" or "base64" encodings are converted to use "8bit" encoding if they follow the RFC 2045 rules for 8bit text.

If true, overrides the mail.smtp.allow8bitmime property.

See Also:
Constant Field Values

MAIL_USER

public static final String MAIL_USER
Set the username for the account at the mail host, if any.

See Also:
Constant Field Values

MAIL_PASSWORD

public static final String MAIL_PASSWORD
Set the password for the account at the mail host, if any.

See Also:
Constant Field Values

SMTP_AUTH

public static final String SMTP_AUTH
Use SMTP-AUTH to authenticate to SMTP server. If MAIL_USER is set this property is to true.

See Also:
Constant Field Values

SMTP_START_TLS

public static final String SMTP_START_TLS
Use TLS to encrypt communication with SMTP server.

See Also:
Constant Field Values
Constructor Detail

MailModule

public MailModule()
Method Detail

javaMailSender

@Bean
public org.springframework.mail.javamail.JavaMailSender javaMailSender(org.springframework.core.env.Environment environment)
Publish a JavaMailSender into the application context.

Parameters:
environment - The application environment. Required.
Returns:
A JavaMailSender service.


Copyright © 2012. All Rights Reserved.