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
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.

There are several important points to know about SendRawEmail:

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


public abstract SendRawEmailResponse SendRawEmail(
         SendRawEmailRequest request


Type: Amazon.SimpleEmail.Model.SendRawEmailRequest

Container for the necessary parameters to execute the SendRawEmail service method.

Return Value
Type: Amazon.SimpleEmail.Model.SendRawEmailResponse
The response from the SendRawEmail service method, as returned by SimpleEmailService.


MessageRejectedException Indicates that the action failed, and the message could not be sent. Check the error stack for more information about what caused the error.


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:\n" +
    "To:\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>() { "" };
var from = "";

var request = new SendRawEmailRequest
  Destinations = to,
  RawMessage = raw,
  Source = from


Version Information

.NET Framework:
Supported in: 4.5, 4.0, 3.5