--- title: "Add-EmailMessageAttachments" slug: "scripting-add-emailmessageattachments" updated: 2025-07-16T20:33:59Z published: 2025-07-16T20:33:59Z canonical: "help.agilityblue.com/scripting-add-emailmessageattachments" --- > ## 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. # Add-EmailMessageAttachments ## Summary Adds a list of attachments to an email message. ```powershell Add-EmailMessageAttachments    -Entries ``` Returns a bulk import results object. ## Parameters | Parameter | Type | Required? | Notes | | --- | --- | --- | --- | | Entries | List of [Email Message Attachment](https://apidocs.agilityblue.com/#ac8fa01c-83b2-464c-b93f-865b271562b2) objects | Yes | The list of email message attachment objects to create as a new entries. | ## Examples ### Add email message attachments ```powershell # Create a list of email message attachments that will be linked to an email message # The file must already exist prior to adding them $emailMessageAttachments = @(  @{    EmailMessageId = 59    FileId = "30eb90c892c74033ab478a0bf1651c79"  } ) # Pass the email message attachment object to the Add-EmailMessageAttachments command to create the entries $createdEmailMessageAttachments = Add-EmailMessageAttachments -Entries $emailMessageAttachments # Use Write-Output to log the execution results Write-Output "Linked $($createdEmailMessageAttachments.Inserts) attachment(s) to email message 59" ``` Execution results: ```plaintext Linked 1 attachment(s) to email message 59 ```