Skip to content

SESV2Client.send_email

rboto-sesv2==0.4.0 · Service index · Types

Model summary (excerpt): Sends an email message. You can use the Amazon SES API v2 to send the following types of messages: Simple – A standard email message. When you create this type of message, you specify the sender, the recipient, and the message body, and Amazon SES assembles the message for you. Raw – A raw, MIME-formatted email message. When you send this type of email, you have to specify all of the message...

Install and imports

python -m pip install "rboto[sesv2]==0.4.0"
from rboto import SESV2Client
from collections.abc import Sequence
from rboto_sesv2.types import (
    ConfigurationOverrides,
    Destination,
    EmailContent,
    ListManagementOptions,
    MessageTag,
    SendEmailOutput,
)

Signature

async def send_email(
    *,
    content: EmailContent,
    from_email_address: str | None = None,
    from_email_address_identity_arn: str | None = None,
    destination: Destination | None = None,
    reply_to_addresses: Sequence[str] | None = None,
    feedback_forwarding_email_address: str | None = None,
    feedback_forwarding_email_address_identity_arn: str | None = None,
    email_tags: Sequence[MessageTag] | None = None,
    configuration_set_name: str | None = None,
    endpoint_id: str | None = None,
    tenant_name: str | None = None,
    list_management_options: ListManagementOptions | None = None,
    configuration_overrides: ConfigurationOverrides | None = None,
) -> SendEmailOutput: ...

Arguments without defaults are required. None omits an optional request argument. Static types do not validate resource existence, permissions, lengths, ranges, or conditional service requirements.

Arguments

Argument Required Model notes (excerpt)
content Yes An object that contains the body of the message. You can send either a Simple message, Raw message, or a Templated message.
from_email_address No The email address to use as the "From" address for the email. The address that you specify has to be verified.
from_email_address_identity_arn No This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the FromEmailAddress parameter. For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes you to use...
destination No An object that contains the recipients of the email message.
reply_to_addresses No The "Reply-to" email addresses for the message. When the recipient replies to the message, each Reply-to address receives the reply.
feedback_forwarding_email_address No The address that you want bounce and complaint notifications to be sent to.
feedback_forwarding_email_address_identity_arn No This parameter is used only for sending authorization. It is the ARN of the identity that is associated with the sending authorization policy that permits you to use the email address specified in the FeedbackForwardingEmailAddress parameter. For example, if the owner of example.com (which has ARN arn:aws:ses:us-east-1:123456789012:identity/example.com) attaches a policy to it that authorizes...
email_tags No A list of tags, in the form of name/value pairs, to apply to an email that you send using the SendEmail operation. Tags correspond to characteristics of the email that you define, so that you can publish email sending events.
configuration_set_name No The name of the configuration set to use when sending the email.
endpoint_id No The ID of the multi-region endpoint (global-endpoint).
tenant_name No The name of the tenant through which this email will be sent. The email sending operation will only succeed if all referenced resources (identities, configuration sets, and templates) are associated with this tenant.
list_management_options No An object used to specify a list or topic to which an email belongs, which will be used when a contact chooses to unsubscribe.
configuration_overrides No An object that overrides, for this message only, settings that would otherwise apply to it. Each setting that you don't override keeps the value that already applies.

Output

SendEmailOutput.

Read-only native attributes, accessed as response.field. Collection getters materialize Python values; to_dict() recursively materializes a mapping. Streams are consumed once.

Field Type Presence References
message_id str | None Always present —

| None means a value can be absent. Output mappings include every declared key; optional input keys may be omitted. Unknown output enum/union variants are not automatically valid inputs.

ConfigurationOverrides, Destination, EmailContent, ListManagementOptions, MessageTag, SendEmailOutput

Follow these links for nested inputs and outputs; recursive types link back to the same type page.

Pagination and streaming

No generated paginator for this operation.

No output stream.

Errors

Import from rboto_sesv2.exceptions:

AccountSuspendedError, BadRequestError, LimitExceededError, MailFromDomainNotVerifiedError, MessageRejectedError, NotFoundError, SendingPausedError, TooManyRequestsError.

Other service failures use the service base error; credential, transport and timeout failures use shared errors.

Example

Complete, type-checked service example. Replace its placeholders and configure credentials before running it.

import asyncio

from rboto import SESV2Client
from rboto_sesv2.types import EmailContent


async def main() -> None:
    client = SESV2Client(region="us-east-1")
    content: EmailContent = {
        "simple": {
            "subject": {"data": "Hello from rboto"},
            "body": {"text": {"data": "Your report is ready."}},
        },
    }
    # Use verified identities; sandbox accounts also require verified recipients.
    response = await client.send_email(
        from_email_address="sender@example.com",
        destination={"to_addresses": ["recipient@example.com"]},
        content=content,
    )
    print(response.message_id)


if __name__ == "__main__":
    asyncio.run(main())

Service guide · Pinned model