Example usage for com.amazonaws.services.simpleemail AWSJavaMailTransport AWS_ACCESS_KEY_PROPERTY

List of usage examples for com.amazonaws.services.simpleemail AWSJavaMailTransport AWS_ACCESS_KEY_PROPERTY

Introduction

In this page you can find the example usage for com.amazonaws.services.simpleemail AWSJavaMailTransport AWS_ACCESS_KEY_PROPERTY.

Prototype

String AWS_ACCESS_KEY_PROPERTY

To view the source code for com.amazonaws.services.simpleemail AWSJavaMailTransport AWS_ACCESS_KEY_PROPERTY.

Click Source Link

Usage

From source file:com.clicktravel.infrastructure.mail.aws.AmazonMailSender.java

License:Apache License

public void init() {
    final Properties props = getJavaMailProperties();
    props.setProperty(MAIL_TRANSPORT_PROTOCOL_KEY, "aws");
    props.setProperty(AWSJavaMailTransport.AWS_ACCESS_KEY_PROPERTY, awsCredentials.getAWSAccessKeyId());
    props.setProperty(AWSJavaMailTransport.AWS_SECRET_KEY_PROPERTY, awsCredentials.getAWSSecretKey());
    // set port to -1 to ensure that Spring calls the equivalent of "transport.connect()"
    setPort(-1);/*from w w w  .  j  ava 2s. c om*/
}

From source file:org.springframework.integration.aws.ses.core.DefaultAmazonSESMailSender.java

License:Apache License

public DefaultAmazonSESMailSender(AWSCredentials credentials) {

    if (credentials == null) {
        throw new AWSOperationException(null,
                "Credentials cannot be null, provide a non null valid set of credentials");
    }/*from  w w  w. j a  v  a  2s  . c om*/

    /*
     * Setup JavaMail to use the Amazon Simple Email Service by specifying
     * the "aws" protocol.
     */
    Properties properties = new Properties();
    properties.setProperty("mail.transport.protocol", "aws");

    properties.setProperty(AWSJavaMailTransport.AWS_ACCESS_KEY_PROPERTY, credentials.getAccessKey());
    properties.setProperty(AWSJavaMailTransport.AWS_SECRET_KEY_PROPERTY, credentials.getSecretKey());

    javaMailSender.setJavaMailProperties(properties);

}