AWS services or capabilities described in AWS Documentation may vary by region/location. Click Getting Started with Amazon AWS to see specific differences applicable to the China (Beijing) Region.
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.
There are several important points to know about SendRawEmail
:
SendRawEmail
enables you to specify the cross-account
identity for the email's "Source," "From," and "Return-Path" parameters in one of
two ways: you can pass optional parameters SourceArn
, FromArn
,
and/or ReturnPathArn
to the API, or you can include the following X-headers
in the header of your raw email: X-SES-SOURCE-ARN
X-SES-FROM-ARN
X-SES-RETURN-PATH-ARN
SourceIdentityArn
and do not specify either the
FromIdentityArn
or ReturnPathIdentityArn
. (The same note
applies to the corresponding X-headers.) If you only specify the SourceIdentityArn
,
Amazon SES will simply set the "From" address and the "Return Path" address to the
identity specified in SourceIdentityArn
. For more information about sending
authorization, see the Amazon
SES Developer Guide.Namespace: Amazon.SimpleEmail.Model
Assembly: AWSSDK.dll
Version: (assembly version)
public class SendRawEmailRequest : AmazonSimpleEmailServiceRequest IRequestEvents
The SendRawEmailRequest type exposes the following members
Name | Description | |
---|---|---|
![]() |
SendRawEmailRequest() | Empty constructor used to set properties independently even when a simple constructor is available |
![]() |
SendRawEmailRequest(RawMessage) | Instantiates SendRawEmailRequest with the parameterized properties |
Name | Type | Description | |
---|---|---|---|
![]() |
Destinations | System.Collections.Generic.List<System.String> |
Gets and sets the property Destinations.
A list of destinations for the message, consisting of To:, CC:, and BCC: addresses. |
![]() |
FromArn | System.String |
Gets and sets the property FromArn.
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 specify a particular "From" address in the header of the raw email.
Instead of using this parameter, you can use the X-header SendRawEmail
in this guide, or see the Amazon
SES Developer Guide. |
![]() |
RawMessage | Amazon.SimpleEmail.Model.RawMessage |
Gets and sets the property RawMessage.
The raw text of the message. The client is responsible for ensuring the following:
|
![]() |
ReturnPathArn | System.String |
Gets and sets the property ReturnPathArn.
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
For example, if the owner of
Instead of using this parameter, you can use the X-header SendRawEmail
in this guide, or see the Amazon
SES Developer Guide. |
![]() |
Source | System.String |
Gets and sets the property Source.
The identity's email address. If you do not provide a value for this parameter, you must specify a "From" address in the raw text of the message. (You can also specify both.)
By default, the string must be 7-bit ASCII. If the text must contain any other characters,
then you must use MIME encoded-word syntax (RFC 2047) instead of a literal string.
MIME encoded-word syntax uses the following form: Source parameter and have feedback forwarding
enabled, then bounces and complaints will be sent to this email address. This takes
precedence over any Return-Path header that you might include in the raw text
of the message. |
![]() |
SourceArn | System.String |
Gets and sets the property SourceArn.
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 send
for the email address specified in the
For example, if the owner of
Instead of using this parameter, you can use the X-header SendRawEmail
in this guide, or see the Amazon
SES Developer Guide. |
This example shows how to send a raw email.
// using System.IO; var sesClient = new AmazonSimpleEmailServiceClient(); var stream = new MemoryStream( Encoding.UTF8.GetBytes("From: johndoe@example.com\n" + "To: janedoe@example.com\n" + "Subject: You're invited to the meeting\n" + "Content-Type: text/plain\n\n" + "Please join us Monday at 7:00 PM.") ); var raw = new RawMessage { Data = stream }; var to = new List<string>() { "janedoe@example.com" }; var from = "johndoe@example.com"; var request = new SendRawEmailRequest { Destinations = to, RawMessage = raw, Source = from }; sesClient.SendRawEmail(request);
.NET Framework:
Supported in: 4.5, 4.0, 3.5
.NET for Windows Store apps:
Supported in: Windows 8.1, Windows 8
.NET for Windows Phone:
Supported in: Windows Phone 8.1, Windows Phone 8