GetRawMessageContentCommand

Retrieves the raw content of an in-transit email message, in MIME format.

Example Syntax

Use a bare-bones client and the command you need to make an API call.

import { WorkMailMessageFlowClient, GetRawMessageContentCommand } from "@aws-sdk/client-workmailmessageflow"; // ES Modules import
// const { WorkMailMessageFlowClient, GetRawMessageContentCommand } = require("@aws-sdk/client-workmailmessageflow"); // CommonJS import
const client = new WorkMailMessageFlowClient(config);
const input = { // GetRawMessageContentRequest
  messageId: "STRING_VALUE", // required
};
const command = new GetRawMessageContentCommand(input);
const response = await client.send(command);
// consume or destroy the stream to free the socket.
const bytes = await response.messageContent.transformToByteArray();
// const str = await response.messageContent.transformToString();
// response.messageContent.destroy(); // only applicable to Node.js Readable streams.

// { // GetRawMessageContentResponse
//   messageContent: "<SdkStream>", // see \@smithy/types -> StreamingBlobPayloadOutputTypes // required
// };

GetRawMessageContentCommand Input

Parameter
Type
Description
messageId
Required
string | undefined

The identifier of the email message to retrieve.

GetRawMessageContentCommand Output

Parameter
Type
Description
$metadata
Required
ResponseMetadata
Metadata pertaining to this request.
messageContent
Required
StreamingBlobPayloadOutputTypes

Throws

Name
Fault
Details
ResourceNotFoundException
client

The requested email message is not found.

WorkMailMessageFlowServiceException
Base exception class for all service exceptions from WorkMailMessageFlow service.