drquinn
drquinn

Reputation: 477

Is it possible to set the 'In-Reply-To' header on outgoing emails with AWS SES Boto3

I'm currently using the Boto 3 python library to send an email with Amazon SES. I'm using the send_email function, which allows me to set various headers in the outgoing email. However I do not see any way to set the 'In-Reply-To' header. Is it possible with this library?

The docs don't seem to mention any way to achieve this. https://boto3.amazonaws.com/v1/documentation/api/latest/reference/services/ses.html#SES.Client.send_email

Upvotes: 2

Views: 1844

Answers (1)

leafarlins
leafarlins

Reputation: 9

You can add a list with the field "ReplyToAddresses".

Adding this field in the example in https://docs.aws.amazon.com/ses/latest/dg/send-an-email-using-sdk-programmatically.html

REPLYTO=["[email protected]","[email protected]"]
#Provide the contents of the email.
response = client.send_email(
    Destination={
        'ToAddresses': [
            RECIPIENT,
        ],
    },
    Message={
        'Body': {
            'Html': {
                'Charset': CHARSET,
                'Data': BODY_HTML,
            },
            'Text': {
                'Charset': CHARSET,
                'Data': BODY_TEXT,
            },
        },
        'Subject': {
            'Charset': CHARSET,
            'Data': SUBJECT,
        },
    },
    Source=SENDER,
    ReplyToAddresses=REPLYTO,
    # If you are not using a configuration set, comment or delete the
    # following line
    ConfigurationSetName=CONFIGURATION_SET,
)

Upvotes: 0

Related Questions