Skip to main content

Search OfficeIMO

Enter a topic, API type, or PowerShell command.

Documentation Search all OfficeIMO/
Cmdlet

Get-OfficeEmail

Module PSWriteOffice
Inputs
System.String
Outputs
OfficeIMO.Email.EmailDocument OfficeIMO.Email.EmailReadResult OfficeIMO.Email.Store.EmailStoreReadResult

Reads a native EML, EMLX, MSG, or TNEF artifact with bounded diagnostics.

Syntax

Get-OfficeEmail [-AsResult] [-Options <EmailReaderOptions>] [-Path] <String> [-StoreOptions <EmailStoreReaderOptions>] [<CommonParameters>]
#
Parameter set: All Parameter Sets

Examples

Authored help example

Read a message without retaining attachment payloads.

$options = New-OfficeEmailReaderOptions -ExcludeAttachmentContent -MaxAttachmentBytes 25MB
Get-OfficeEmail -Path .\Message.msg -Options $options -AsResult

Parameters

-AsResult SwitchParameter optional
Return the read result with diagnostics and consumed byte count.
-Options EmailReaderOptions optional
Optional format detection, compound-file, MIME, attachment, and size limits.
-Path String requiredposition: 0pipeline: True (ByValue, ByPropertyName)aliases: FullName, LiteralPath
Path to an EML, EMLX, MSG, TNEF, or winmail.dat file.
-StoreOptions EmailStoreReaderOptions optional
Optional Apple Mail EMLX envelope, metadata, attachment, and size limits.

Common Parameters

This command supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable.

For more information, see about_CommonParameters.