Class SesTransport
Sends mail through Amazon SES, by its API rather than its SMTP endpoint: one signed HTTPS request a mail, and no SMTP credentials to issue.
cn1.mail.url=ses://eu-west-1
Credentials are the machine's own -- the environment, a container role or an instance role -- found as for every other AWS service here. The sender has to be an identity SES has verified.
| Setting | Default | |
|---|---|---|
cn1.mail.ses.configuration-set |
the configuration set a mail is sent with | |
cn1.mail.ses.region |
us-east-1 |
the region to sign for, when the URL names a host and not a region |
The mail is handed over as it was encoded, so what arrives is what an SMTP
server would have been given. SES takes at most 50 recipients a request; a
mail to more is sent in several. ses://localhost:4566 names an endpoint
instead of a region, for a stand-in on the same machine.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classOpensses:URLs; what the generated wiring registers. -
Constructor Summary
ConstructorsConstructorDescriptionSesTransport(String url, String region, String configurationSet) A transport forurl.SesTransport(String url, String region, String configurationSet, Credentials fixed) A transport forurlthat signs withfixedrather than with what the environment, the container or the instance provides -- for an account other than the one the server runs as. -
Method Summary
-
Constructor Details
-
SesTransport
A transport for
url.region: the region to sign for whenurlnames a host; may be nullconfigurationSet: the configuration set to send with, or null
- Throws:
IOException
-
SesTransport
public SesTransport(String url, String region, String configurationSet, Credentials fixed) throws IOException A transport for
urlthat signs withfixedrather than with what the environment, the container or the instance provides -- for an account other than the one the server runs as. Credentials given this way are never refreshed, so they should not be ones that expire.region: the region to sign for whenurlnames a host; may be nullconfigurationSet: the configuration set to send with, or nullfixed: the credentials to sign with, or null to resolve them
- Throws:
IOException
-
-
Method Details
-
getName
Description copied from class:MailTransportWhat this transport is:smtp,ses,memory,log.- Specified by:
getNamein classMailTransport
-
send
Description copied from class:MailTransportHands one mail over, returning when the other side has taken it.
Throws a
MailExceptionwhoseMailException.isPermanent()says whether trying again could help; any other IOException is taken to be a failure of the connection, and is retried.from: the address a bounce goes to, without a display namerecipients: the addresses to deliver to, without display namesmime: the whole message, CRLF line endings, not dot-stuffed
- Specified by:
sendin classMailTransport- Throws:
IOException
-
isHealthy
public boolean isHealthy()Description copied from class:MailTransportWhether the transport could reach its server the last time it tried. One that has not tried yet is healthy.- Overrides:
isHealthyin classMailTransport
-
close
public void close()Description copied from class:MailTransportCloses connections it holds. Never throws.- Specified by:
closein classMailTransport
-