Open buckett opened 1 week ago
The stack trace we were seeing:
java.lang.NullPointerException: null
at java.util.Objects.requireNonNull
at java.util.Arrays$ArrayList.<init>
at java.util.Arrays.asList
at software.amazon.awssdk.services.ses.model.Destination$BuilderImpl.toAddresses(Destination.java:391)
at io.awspring.cloud.ses.SimpleEmailServiceMailSender.prepareMessage(SimpleEmailServiceMailSender.java:114)
at io.awspring.cloud.ses.SimpleEmailServiceMailSender.send(SimpleEmailServiceMailSender.java:84)
at io.awspring.cloud.ses.SimpleEmailServiceMailSender.send(SimpleEmailServiceMailSender.java:74)
[..snipped..]
Type: Bug
Component: SES
Describe the bug Unable to send an email that doesn't have an TO: address.
We were attempting to send an email that just has lots of BCCs (no TO: address) and this worked with JavaMail, but when we switched to using the Spring Cloud AWS integration it started failing. According to the documentation on SES it states:
Sample
Workaround
To workaround this you can set the to address to be
new String[]{}
which is the same as passing nothing. This ends up setting the to address to not be null, but doesn't cause problems with the SES implementation.Passing
null
doesn't work as this creates an array with one item (of valuenull
) which then fails because it's not a valid email.