< Back

New-MgaMailMessage

Sat Jan 18, 2020 4:42 pm

NAME New-MgaMailMessage



SYNOPSIS

Creates a folder in Exchange Online using the graph api.





SYNTAX

New-MgaMailMessage [-Subject] <String[]> [-Sender <String>] [-From <String>] [-ToRecipients <String[]>]

[-CCRecipients <String[]>] [-BCCRecipients <String[]>] [-ReplyTo <String[]>] [-Body <String>] [-Categories

<String[]>] [-Importance <String>] [-InferenceClassification <String>] [-InternetMessageId <String>]

[-IsDeliveryReceiptRequested <Boolean>] [-IsReadReceiptRequested <Boolean>] [-User <String>] [-Token

<AzureAccessToken>] [-WhatIf] [-Confirm] [<CommonParameters>]



New-MgaMailMessage [-Subject] <String[]> [[-Folder] <FolderParameter>] [-Sender <String>] [-From <String>]

[-ToRecipients <String[]>] [-CCRecipients <String[]>] [-BCCRecipients <String[]>] [-ReplyTo <String[]>] [-Body

<String>] [-Categories <String[]>] [-Importance <String>] [-InferenceClassification <String>] [-InternetMessageId

<String>] [-IsDeliveryReceiptRequested <Boolean>] [-IsReadReceiptRequested <Boolean>] [-User <String>] [-Token

<AzureAccessToken>] [-WhatIf] [-Confirm] [<CommonParameters>]





DESCRIPTION

Creates a new folder in Exchange Online using the graph api.





PARAMETERS

-Subject <String[]>

The subject of the new message.



Required? true

Position? 1

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Folder <FolderParameter>

The folder where the new folder should be created in. Do not specify to create

a folder on the root level.



Possible values are a valid folder Id or a Mga folder object passed in.

Tab completion is available on this parameter for a list of well known folders.



Required? false

Position? 2

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Sender <String>

The account that is actually used to generate the message.

(Updatable only when sending a message from a shared mailbox or sending a message as a delegate.

In any case, the value must correspond to the actual mailbox used.)



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-From <String>

The mailbox owner and sender of the message.

Must correspond to the actual mailbox used.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ToRecipients <String[]>

The To recipients for the message.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-CCRecipients <String[]>

The Cc recipients for the message.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-BCCRecipients <String[]>

The Bcc recipients for the message.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-ReplyTo <String[]>

The email addresses to use when replying.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Body <String>

The body of the message.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Categories <String[]>

The categories associated with the message.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Importance <String>

The importance of the message.

The possible values are: Low, Normal, High.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InferenceClassification <String>

The classification of the message for the user, based on inferred relevance or importance, or on an explicit

override.

The possible values are: focused or other.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-InternetMessageId <String>

The message ID in the format specified by RFC2822.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-IsDeliveryReceiptRequested <Boolean>

Indicates whether a delivery receipt is requested for the message.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-IsReadReceiptRequested <Boolean>

Indicates whether a read receipt is requested for the message.



Required? false

Position? named

Default value False

Accept pipeline input? false

Accept wildcard characters? false



-User <String>

The user-account to access. Defaults to the main user connected as.

Can be any primary email name of any user the connected token has access to.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Token <AzureAccessToken>

The token representing an established connection to the Microsoft Graph Api.

Can be created by using New-MgaAccessToken.

Can be omitted if a connection has been registered using the -Register parameter on New-MgaAccessToken.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-WhatIf [<SwitchParameter>]

If this switch is enabled, no actions are performed but informational messages will be displayed that explain

what would happen if the command were to run.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



-Confirm [<SwitchParameter>]

If this switch is enabled, you will be prompted for confirmation before executing any operations that change

state.



Required? false

Position? named

Default value

Accept pipeline input? false

Accept wildcard characters? false



<CommonParameters>

This cmdlet supports the common parameters: Verbose, Debug,

ErrorAction, ErrorVariable, WarningAction, WarningVariable,

OutBuffer, PipelineVariable, and OutVariable. For more information, see

about_CommonParameters (https:/go.microsoft.com/fwlink/?LinkID=113216).



INPUTS



OUTPUTS

MSGraph.Exchange.Mail.Message





NOTES





For addiontional information go to:

https://docs.microsoft.com/en-us/graph/ ... h-rest-1.0



-------------------------- EXAMPLE 1 --------------------------



PS C:\\>New-MgaMailMessage -ToRecipients 'someone@something.org' -Subject 'A new Mail' -Body 'This is a new mail'



Creates a new message in the drafts folder









-------------------------- EXAMPLE 2 --------------------------



PS C:\\>New-MgaMailMessage -Subject 'A new Mail' -Folder 'MyFolder'



Creates a new message in the folder named "MyFolder"











RELATED LINKS