public class AWSJavaMailTransport
extends javax.mail.Transport
This transport implementation only accepts MIME encoded messages (see MimeMessage class) and RFC822 E-mail addresses (see InternetAddress class).
Modifier and Type | Field and Description |
---|---|
static String |
AWS_ACCESS_KEY_PROPERTY |
static String |
AWS_EMAIL_SERVICE_ENDPOINT_PROPERTY |
static String |
AWS_SECRET_KEY_PROPERTY |
Constructor and Description |
---|
AWSJavaMailTransport(javax.mail.Session session,
javax.mail.URLName urlname) |
Modifier and Type | Method and Description |
---|---|
<X extends AmazonWebServiceRequest> |
appendUserAgent(X request,
String userAgent) |
void |
close() |
protected boolean |
protocolConnect(String host,
int port,
String awsAccessKey,
String awsSecretKey)
Sets up a new AmazonSimpleEmailServiceClient.
|
void |
sendMessage(javax.mail.Message msg,
javax.mail.Address[] addresses)
Sends a MIME message through Amazon's E-mail Service with the specified
recipients.
|
addTransportListener, notifyTransportListeners, removeTransportListener, send, send
public static final String AWS_EMAIL_SERVICE_ENDPOINT_PROPERTY
public static final String AWS_SECRET_KEY_PROPERTY
public static final String AWS_ACCESS_KEY_PROPERTY
public AWSJavaMailTransport(javax.mail.Session session, javax.mail.URLName urlname)
public void sendMessage(javax.mail.Message msg, javax.mail.Address[] addresses) throws javax.mail.MessagingException, javax.mail.SendFailedException
sendMessage
in class javax.mail.Transport
msg
- A Mime type e-mail message to be sentaddresses
- Additional e-mail addresses (RFC-822) to be included in the
messagejavax.mail.MessagingException
javax.mail.SendFailedException
protected boolean protocolConnect(String host, int port, String awsAccessKey, String awsSecretKey)
protocolConnect
in class javax.mail.Service
host
- Optional - host specifies the AWS E-mail endpointawsAccessKey
- Optional - AWS Access Key (otherwise must specify through
properties file)awsSecretKey
- Optional - AWS Secret key (otherwise must specify through
properties file)public void close() throws javax.mail.MessagingException
close
in class javax.mail.Service
javax.mail.MessagingException
public <X extends AmazonWebServiceRequest> X appendUserAgent(X request, String userAgent)
Copyright © 2015. All rights reserved.