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() |
String |
getLastMessageId()
The unique message identifier ot the last message sent by
sendMessage |
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, sendpublic 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.Transportmsg - A Mime type e-mail message to be sentaddresses - Additional e-mail addresses (RFC-822) to be included in the
messagejavax.mail.MessagingExceptionjavax.mail.SendFailedExceptionprotected boolean protocolConnect(String host, int port, String awsAccessKey, String awsSecretKey)
protocolConnect in class javax.mail.Servicehost - 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.Servicejavax.mail.MessagingExceptionpublic String getLastMessageId()
The unique message identifier ot the last message sent by sendMessage
sendMessage action.public <X extends AmazonWebServiceRequest> X appendUserAgent(X request, String userAgent)
Copyright © 2020. All rights reserved.