Skip to content
pzb edited this page Feb 7, 2012 · 27 revisions

SendRawEmail

Description

Sends an email message, with header and content specified by the client. The SendRawEmail action is useful for sending multipart MIME emails. The raw text of the message must comply with Internet email standards; otherwise, the message cannot be sent.

Request parameters

Parameter Name Value(s) Required? Example
Source Exactly one normalized Mailbox No james@example.org
Destinations.member.N Exactly one normalized Mailbox No bsmith@example.com
RawMessage.Data Any valid Internet Message Format text that has been base64 encoded. Yes see example below

Comments

Any parameter that has a N, can be repeated multiple times. In all cases, the N must be replaced with a number from 1 to 99.

The total number of recipients specified can be no more than 50.

The whole message must be base64 encoded before being passed in the RawMessage.Data parameter. See the example if this is not clear.

Note that the Source parameter to this method has the same meaning as the ReturnPath parameter to the SendEmail method. In this method, the From information is only included the header of the RawMessage.

If the Source parameter is not defined, then

  • SES will use the Mailbox of the Return-Path header if it exists, otherwise
  • SES will use the Mailbox of the Sender header if it exists, otherwise
  • SES will use the Mailbox of the From header

If no Destinations parameters are defined then SES will use all Mailboxes in the To, Cc, and Bcc headers.

Message and MIME headers

The following headers are allowed in the RawMessage. The From and Subject headers are the only required headers.

If you do not include any destination headers (To, Cc, or Bcc) then SES will add a To header with the all the recipient addresses. To avoid this, simple add a Bcc header with any properly formed Mailbox. Bcc: nobody@example.com works fine for this purpose.

Name Message Header MIME Part Header Notes
Accept-Language Yes No
Auto-Submitted Yes No
Bcc Yes No Is is recommended to NOT include this header. Instead include the recipients in the Destinations parameter. If the Bcc header is provided, SES will remove it before sending the message.
Cc Yes No
Comments Yes No
Content-Description No Yes
Content-Disposition Yes Yes
Content-ID Yes Yes
Content-Language Yes Yes
Content-Transfer-Encoding Yes Yes
Content-Type Yes Yes See the section on allowed content types for more information.
Date Yes No It is recommended to NOT include this header. SES will replace any Date header provided with a SES generated Date header.
Disposition-Notification-To Yes No
DKIM-Signature Yes No Do not include the Message-ID, Date, Return-Path, Received, or Bcc headers in the list of signed headers. FIXME: This header is not standardized, but is important.
DomainKey-Signature Yes No Do not include the Message-ID, Date, Return-Path, Received, or Bcc headers in the list of signed headers.
Errors-To Yes No I recommend to NOT include this header. There is no standard defining this header and different servers may do different things. Use the Source parameter instead.
From Yes No All Mailboxes in this header must be in the account's list of verified addresses.
In-Reply-To Yes No
Keywords Yes No
List-Archive Yes No
List-Help Yes No
List-Id Yes No
List-Owner Yes No
List-Post Yes No
List-Subscribe Yes No
List-Unsubscribe Yes No
Message-Id Yes No It is recommended to NOT include this header. SES will replace any Message-Id header provided with a SES generated Message-Id header.
MIME-Version Yes No
Organization Yes No
Precedence Yes No FIXME: This header is not standardized, but is important. See ReturnPath Blog entry
Received Yes No I recommend to NOT include this header. SES will generate add some received headers, but you will almost surely end up with a missing link or two in the received header chain, which can trigger some spam filters.
References Yes No
Reply-To Yes No
Return-Path Yes No It is recommended to NOT include this header. Instead use the Source parameter. SES will remove this header before sending the message.
Sender Yes No This header is required if the From header has multiple mailboxes. The Mailbox in this header must be in the account's list of verified addresses.
Subject Yes No
Thread-Index Yes No I recommend to NOT include this header. There is no standard defining this header and different servers may do different things.
Thread-Topic Yes No I recommend to NOT include this header. There is no standard defining this header and different servers may do different things.
To Yes No
User-Agent Yes No
Any header starting with "X-" Yes Yes All headers starting with "X-" are experimental headers and have no standard definition. Mail clients and servers are free to ignore them. Any number of "X-" headers may be specified and the same header may be included multiple times.

Example Mail that uses MIME

From: Chuck Johnson <charles@example.org>
To: Beth Jones <elizabeth.jones@example.net>
Subject: Order Information
Mime-Version: 1.0
Content-Type: multipart/alternative;
 boundary="--==_mimepart_4dab06b0c05d5_431c243ddf262394c"

----==_mimepart_4dab06b0c05d5_431c243ddf262394c
Content-Type: text/plain;
 charset=UTF-8
Content-Transfer-Encoding: quoted-printable
Content-ID: <4dab06b51da75_431c243ddf26240fe@testmx.example.org>

Thank you for ordering from Example Industries.  The following items will be
shipped to you as soon as they are available.

Jurg van Vliet: Programming Amazon EC2
    Quantity: 1 Price: $28.72

Frank Munz: Middleware and Cloud Computing: Oracle on
Amazon Web Services (AWS), Rackspace Cloud and RightScale
    Quantity: 1 Price: $64.95

Jeff Barr: Host Your Web Site on the Cloud: Amazon Web Services Made Easy
    Quantity: 1 Price: =C2=A5 3,504

----==_mimepart_4dab06b0c05d5_431c243ddf262394c
Content-Type: text/html
Content-ID: <4dab06b51f284_431c243ddf26241cc@testmx.example.org>

<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
<head><title>Order Information</title></head>
<body>
<p>Thank you for ordering from Example Industries.  The following items will be shipped to you as soon as they are available.<p>
<table style="border: 0;">
<tr><th>Item|Quantity|Price</th></tr>
<img src="http://www.example.com/book1.jpg" width="57" height="75" alt="Book Cover"><br>Jurg van Vliet: Programming Amazon EC2|1|$28.72
<img src="http://www.example.com/book2.jpg" width="53" height="75" alt="Book Cover"><br>Frank Munz: Middleware and Cloud Computing: Oracle on Amazon Web Services (AWS), Rackspace Cloud and RightScale|1|$64.95
<img src="http://www.example.com/book3.jpg" width="58" height="75" alt="Book Cover"><br>Jeff Barr: Host Your Web Site on the Cloud: Amazon Web Services Made Easy|1|&yen; 3,504

</body>
</html>

----==_mimepart_4dab06b0c05d5_431c243ddf262394c--

Example request using GET

GET /?Action=SendRawEmail&Destinations.member.1=elizabeth.jones%40example.net&RawMessage.Data=RnJvbTogQ2h1Y2sgSm9obnNvbiA8Y2hhcmxlc0BleGFtcGxlLm9yZz4KVG86IEJldGggSm9uZXMgPGVsaXphYmV0aC5qb25lc0BleGFtcGxlLm5ldD4KU3ViamVjdDogT3JkZXIgSW5mb3JtYXRpb24KTWltZS1WZXJzaW9uOiAxLjAKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvYWx0ZXJuYXRpdmU7CiBib3VuZGFyeT0iLS09PV9taW1lcGFydF80ZGFiMDZiMGMwNWQ1XzQzMWMyNDNkZGYyNjIzOTRjIgoKLS0tLT09X21pbWVwYXJ0XzRkYWIwNmIwYzA1ZDVfNDMxYzI0M2RkZjI2MjM5NGMKQ29ud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lnaHQ9Ijc1IiBhbHQ9IkJvb2sgQ292ZXIiPjxicj5KZWZmIEJhcnI6IEhvc3QgWW91ciBXZWIgU2l0ZSBvbiB0aGUgQ2xvdWQ6IEFtYXpvbiBXZWIgU2VydmljZXMgTWFkZSBFYXN5PC90ZD48dGQ%2BMTwvdGQ%2BPHRkPiZ5ZW47IDMsNTA0PC90ZD48L3RyPgo8L3RhYmxlPgo8L2JvZHk%2BCjwvaHRtbD4KCi0tLS09PV9taW1lcGFydF80ZGFiMDZiMGMwNWQ1XzQzMWMyNDNkZGYyNjIzOTRjLS0%3D&Source=bounce-management%40example.org HTTP/1.1
Host: email.us-east-1.amazonaws.com
Date: Sun, 17 Apr 2011 12:34:29 -0400
X-Amzn-Authorization: AWS3-HTTPS AWSAccessKeyId=AKIAH3VO4JIRTLHHP4AK,Algorithm=HmacSHA256,Signature=WvHYYboGvYqBDzNdalup2YZXIJtf/Yj9vuZD1KjxcXI=

Example request using POST

POST / HTTP/1.1
Host: email.us-east-1.amazonaws.com
Date: Sun, 17 Apr 2011 12:34:29 -0400
X-Amzn-Authorization: AWS3-HTTPS AWSAccessKeyId=AKIAH3VO4JIRTLHHP4AK,Algorithm=HmacSHA256,Signature=WvHYYboGvYqBDzNdalup2YZXIJtf/Yj9vuZD1KjxcXI=
Content-Length: 2921
Content-Type: application/x-www-form-urlencoded

Action=SendRawEmail&Destinations.member.1=elizabeth.jones%40example.net&RawMessage.Data=RnJvbTogQ2h1Y2sgSm9obnNvbiA8Y2hhcmxlc0BleGFtcGxlLm9yZz4KVG86IEJldGggSm9uZXMgPGVsaXphYmV0aC5qb25lc0BleGFtcGxlLm5ldD4KU3ViamVjdDogT3JkZXIgSW5mb3JtYXRpb24KTWltZS1WZXJzaW9uOiAxLjAKQ29udGVudC1UeXBlOiBtdWx0aXBhcnQvYWx0ZXJuYXRpdmU7CiBib3VuZGFyeT0iLS09PV9taW1lcGFydF80ZGFiMDZiMGMwNWQ1XzQzMWMyNDNkZGYyNjIzOT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xpbWcgc3JjPSJodHRwOi8vd3d3LmV4YW1wbGUuY29tL2Jvb2szLmpwZyIgd2lkdGg9IjU4IiBoZWlnaHQ9Ijc1IiBhbHQ9IkJvb2sgQ292ZXIiPjxicj5KZWZmIEJhcnI6IEhvc3QgWW91ciBXZWIgU2l0ZSBvbiB0aGUgQ2xvdWQ6IEFtYXpvbiBXZWIgU2VydmljZXMgTWFkZSBFYXN5PC90ZD48dGQ%2BMTwvdGQ%2BPHRkPiZ5ZW47IDMsNTA0PC90ZD48L3RyPgo8L3RhYmxlPgo8L2JvZHk%2BCjwvaHRtbD4KCi0tLS09PV9taW1lcGFydF80ZGFiMDZiMGMwNWQ1XzQzMWMyNDNkZGYyNjIzOTRjLS0%3D&Source=bounce-management%40example.org

Example response

<SendRawEmailResponse xmlns="http://ses.amazonaws.com/doc/2010-12-01/">
  <SendRawEmailResult>
    <MessageId>0000012f64555b7c-f9806457-0628-456c-b1b3-7954bd1c8629-000000</MessageId>
  </SendRawEmailResult>
  <ResponseMetadata>
    <RequestId>588f46cb-6911-11e0-939d-21ce54edf914</RequestId>
  </ResponseMetadata>
</SendRawEmailResponse>