--- title: "Get-Contact" slug: "scripting-get-emailmessage" updated: 2025-07-16T20:22:07Z published: 2025-07-16T20:22:07Z canonical: "help.agilityblue.com/scripting-get-emailmessage" --- > ## Documentation Index > Fetch the complete documentation index at: https://help.agilityblue.com/llms.txt > Use this file to discover all available pages before exploring further. # Get-EmailMessage ## Summary Retrieves an existing email message. ```powershell Get-EmailMessage    -Id ``` Returns an [email message](https://apidocs.agilityblue.com/#47ed2fff-291a-4746-bc0c-6f88212e6c99) object. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | Id | Int32 | Yes | The email message id. | ## Examples ### Get an existing email message This example retrieves a specific email message and outputs it as JSON. ```powershell # Get an existing email message $emailMessage = Get-EmailMessage -Id 1 # Convert the email message from a PowerShell object to a JSON object so we can observe the available properties Write-Output $emailMessage | ConvertTo-Json -Depth 10 ``` ```json {  "EmailMessageId": 1,  "ExternalMessageId": "4mhoD3UITUCNiXKpCMYBIQ",  "Direction": "Outbound",  "Status": "Sent",  "To": "jdough@agilityblue.com",  "Cc": null,  "Bcc": null,  "FromAddress": "no-one@nowhere.com",  "FromName": "Max Miller",  "Subject": "Email Test",  "Date": "2020-10-14T13:07:38.9595745+00:00",  "Body": "

Did you try turning it off and then back on, first?

Thanks,
Support

",  "HasAttachments": false,  "ThreadId": null,  "Size": 72,  "IsDeleted": false,  "CreatedOn": "2020-10-14T13:07:39.0957467+00:00",  "CreatedBy": null,  "CreatedByFullName": "Max Miller",  "CreatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",  "SentById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",  "SentOn": "2020-10-14T13:08:14.4514785+00:00",  "SentBy": null,  "SentByFullName": "Max Miller",  "LastUpdatedById": "510e109b-6ff5-4442-9670-cd5e3cd82a7a",  "LastUpdatedOn": "2020-10-14T13:08:14.4681775+00:00",  "LastUpdatedBy": null,  "LastUpdatedByFullName": "Max Miller",  "AssociatedContacts": [    {      "EmailMessageContactId": 1,      "EmailMessageId": 1,      "EmailMessage": null,      "ContactId": 1,      "ContactFullName": "John Dough",      "ContactEmailAddress": "jdough@agilityblue.com",      "ContactNameAndEmailAddress": "John Dough ",      "Contact": null,      "RelationshipTypeId": 1,      "RelationshipTypeName": "To",      "RelationshipType": null    }  ],  "Attachments": [],  "History": [] } ```