SendEmail method
Sends an email from an address in a folder. The folder is selected based on the service account the request originates from.
Alternatively, you can send emails via SMTP protocol.
Request
POST /v2/email/outbound-emails HTTP/2
Request headers
Use common request headers in your requests.
Request body
{
"FromEmailAddress": "<sender_address>",
"FromEmailAddressIdentityArn": "<compatibility_parameter>",
"Destination": {
"ToAddresses": [
"<recipient_address>"
],
"CcAddresses": [
"<copy_recipient_address>"
],
"BccAddresses": [
"<blind_copy_recipient_address>"
]
},
"Content": {
"Simple": {
"Subject": {
"Data": "<subject_text>",
"Charset": "<encoding>"
},
"Body": {
"Text": {
"Data": "<email_text>",
"Charset": "<encoding>"
},
"Html": {
"Data": "<email_text>",
"Charset": "<encoding>"
}
}
},
"Raw": {
"Data": "<overall_email_content>"
}
}
}
Parameter |
Description |
|
Type: String. Address the email is sent from. The address must be verified. |
|
Type: String. Used exclusively for compatibility with AWS. |
|
Type: Object. Object containing parameters that describe your email. |
|
Type: Object. Simple type. You cannot use it together with |
|
Type: Object. Describes the subject:
|
|
Type: Object. Describes the content:
|
|
Type: Object. Raw type. You cannot use it together with
The whole email must reside in the |
Responses
200 OK
{
"MessageId": "<email_ID>"
}
Parameter |
Description |
|
Type: String. Unique ID of the email. |
Errors
For all errors, the response body has the same format:
{
"Code": "<error_name>",
"message": "<error_description>"
}
The name of the error is taken from its code, e.g., BadRequestException
.
Possible errors:
Error code |
Description |
|
The request contains invalid headers or parameters. |
|
For this service account, sending email is disabled permanently. |
|
For this service account, sending email is disabled temporarily. |
|
The email contains invalid data. |
|
The address the email comes from is not verified. |
|
The requested resource was not found. |
|
The request quota was exceeded. |
|
The request limit was exceeded. |