Did this page help you?

   Yes   No   Tell us about it...

com.amazonaws.services.simpleemail
Class AWSJavaMailTransport

java.lang.Object
  extended by javax.mail.Service
      extended by javax.mail.Transport
          extended by com.amazonaws.services.simpleemail.AWSJavaMailTransport

public class AWSJavaMailTransport
extends javax.mail.Transport

A transport implementation using Amazon Web Service's E-mail Service. For JavaMail purposes this transport implementation uses the "aws" protocol. In order to send messages through the E-mail Service your AWS Credentials (http://aws.amazon.com/security-credentials) need to be either in the JavaMail Session's Properties (mail.aws.user and mail.aws.password), passed into the connect() method, or set in the Session's setPasswordAuthentication method. Parameters passed into the connect method as well as PasswordAuthentication information supersedes the properties field for a particular session. When connecting your AWS Access Key is your username and your AWS Secret Key is your password.

This transport implementation only accepts MIME encoded messages (see MimeMessage class) and RFC822 E-mail addresses (see InternetAddress class).


Field Summary
static String AWS_ACCESS_KEY_PROPERTY
           
static String AWS_EMAIL_SERVICE_ENDPOINT_PROPERTY
           
static String AWS_SECRET_KEY_PROPERTY
           
 
Constructor Summary
AWSJavaMailTransport(javax.mail.Session session, javax.mail.URLName urlname)
           
 
Method Summary
<X extends AmazonWebServiceRequest>
X
appendUserAgent(X request, String userAgent)
           
 void close()
           
 void sendMessage(javax.mail.Message msg, javax.mail.Address[] addresses)
          Sends a MIME message through Amazon's E-mail Service with the specified recipients.
 
Methods inherited from class javax.mail.Transport
addTransportListener, removeTransportListener, send, send
 
Methods inherited from class javax.mail.Service
addConnectionListener, connect, connect, connect, connect, getURLName, isConnected, removeConnectionListener, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

AWS_EMAIL_SERVICE_ENDPOINT_PROPERTY

public static final String AWS_EMAIL_SERVICE_ENDPOINT_PROPERTY
See Also:
Constant Field Values

AWS_SECRET_KEY_PROPERTY

public static final String AWS_SECRET_KEY_PROPERTY
See Also:
Constant Field Values

AWS_ACCESS_KEY_PROPERTY

public static final String AWS_ACCESS_KEY_PROPERTY
See Also:
Constant Field Values
Constructor Detail

AWSJavaMailTransport

public AWSJavaMailTransport(javax.mail.Session session,
                            javax.mail.URLName urlname)
Method Detail

sendMessage

public void sendMessage(javax.mail.Message msg,
                        javax.mail.Address[] addresses)
                 throws javax.mail.MessagingException,
                        javax.mail.SendFailedException
Sends a MIME message through Amazon's E-mail Service with the specified recipients. Addresses that are passed into this method are merged with the ones already embedded in the message (duplicates are removed).

Specified by:
sendMessage in class javax.mail.Transport
Parameters:
msg - A Mime type e-mail message to be sent
addresses - Additional e-mail addresses (RFC-822) to be included in the message
Throws:
javax.mail.MessagingException
javax.mail.SendFailedException

close

public void close()
           throws javax.mail.MessagingException
Overrides:
close in class javax.mail.Service
Throws:
javax.mail.MessagingException

appendUserAgent

public <X extends AmazonWebServiceRequest> X appendUserAgent(X request,
                                                             String userAgent)


Copyright © 2010 Amazon Web Services, Inc. All Rights Reserved.