AWS SDK Version 2 for .NET
API Reference

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.

.NET Framework 3.5
 
Represents the raw data of the message.

Inheritance Hierarchy

System.Object
  Amazon.SimpleEmail.Model.RawMessage

Namespace: Amazon.SimpleEmail.Model
Assembly: AWSSDK.dll
Version: (assembly version)

Syntax

C#
public class RawMessage : Object

The RawMessage type exposes the following members

Constructors

NameDescription
Public Method RawMessage() Empty constructor used to set properties independently even when a simple constructor is available
Public Method RawMessage(MemoryStream) Instantiates RawMessage with the parameterized properties

Properties

NameTypeDescription
Public Property Data System.IO.MemoryStream Gets and sets the property Data.

The raw data of the message. The client must ensure that the message format complies with Internet email standards regarding email header fields, MIME types, MIME encoding, and base64 encoding (if necessary).

The To:, CC:, and BCC: headers in the raw message can contain a group list.

If you are using SendRawEmail with sending authorization, you can include X-headers in the raw message to specify the "Source," "From," and "Return-Path" addresses. For more information, see the documentation for SendRawEmail.

Do not include these X-headers in the DKIM signature, because they are removed by Amazon SES before sending the email.

For more information, go to the Amazon SES Developer Guide.

Examples

This example shows how to send a raw email.

Send raw email example

// 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);
      

Version Information

.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