- Newest
- Most votes
- Most comments
Hi,
The following document shows how to use the AWS SDK for PHP to send an email through Amazon SES: https://docs.aws.amazon.com/ses/latest/dg/send-an-email-using-sdk-programmatically.html#send-an-email-using-sdk-programmatically-examples
The code in this tutorial was tested using PHP 7.2.7. This code sample sends the email in both the formats – HTML and plain text. When you use both formats to send the same content in a single message, the recipient's email client decides which to display, based upon its capabilities as discussed here: https://docs.aws.amazon.com/ses/latest/dg/send-email-concepts-email-format.html#send-email-concepts-email-format-body
You may send the email in only HTML format by modifying the Body attribute as follows:
'Body' => [
'Html' => [
'Charset' => $char_set,
'Data' => $html_body,
],
],
Also to view the email in HTML format, please ensure that you use HTML-enabled email clients.
Relevant content
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated 6 months ago
- AWS OFFICIALUpdated a year ago
- AWS OFFICIALUpdated a year ago