optionally define the sender address - otherwise we'll use the address found in the provided headers
$from_name
—
object
optionally define the sender alias
$to
—
object
optionally define the recipients to receive the message - otherwise we'll use the To, Cc, and Bcc headers provided in the document - to[] string the email address of the recipient
$async
—
boolean
enable a background sending mode that is optimized for bulk sending. In async mode, messages/sendRaw will immediately return a status of "queued" for every recipient. To handle rejections when sending in async mode, set up a webhook for the 'reject' event. Defaults to false for messages with no more than 10 recipients; messages with more than 10 recipients are always sent asynchronously, regardless of the value of async.
$ip_pool
—
string
the name of the dedicated ip pool that should be used to send the message. If you do not have any dedicated IPs, this parameter has no effect. If you specify a pool that does not exist, your default pool will be used instead.
$send_at
—
string
when this message should be sent as a UTC timestamp in YYYY-MM-DD HH:MM:SS format. If you specify a time in the past, the message will be sent immediately.
$return_path_domain
—
string
a custom domain to use for the messages's return-path
Returns
array
of structs for each recipient containing the key "email" with the email address, and details of the message status for that recipient - return[] struct the sending results for a single recipient
- email string the email address of the recipient
- status string the sending status of the recipient - either "sent", "queued", "scheduled", "rejected", or "invalid"
- reject_reason string the reason for the rejection if the recipient status is "rejected" - one of "hard-bounce", "soft-bounce", "spam", "unsub", "custom", "invalid-sender", "invalid", "test-mode-limit", or "rule"
- _id string the message's unique id