Edit

Share via


Send-AzEmailServicedataEmail

Queues an email message to be sent to one or more recipients

Syntax

Send (Default)

Send-AzEmailServicedataEmail
    -Endpoint <String>
    -Message <IEmailMessage>
    [-ClientRequestId <String>]
    [-OperationId <String>]
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SendExpanded

Send-AzEmailServicedataEmail
    -Endpoint <String>
    -ContentSubject <String>
    -RecipientTo <IEmailAddress[]>
    -SenderAddress <String>
    [-ClientRequestId <String>]
    [-OperationId <String>]
    [-Attachment <IEmailAttachment[]>]
    [-ContentHtml <String>]
    [-ContentPlainText <String>]
    [-Header <Hashtable>]
    [-RecipientBcc <IEmailAddress[]>]
    [-RecipientCc <IEmailAddress[]>]
    [-ReplyTo <IEmailAddress[]>]
    [-UserEngagementTrackingDisabled]
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SendViaJsonFilePath

Send-AzEmailServicedataEmail
    -Endpoint <String>
    -JsonFilePath <String>
    [-ClientRequestId <String>]
    [-OperationId <String>]
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

SendViaJsonString

Send-AzEmailServicedataEmail
    -Endpoint <String>
    -JsonString <String>
    [-ClientRequestId <String>]
    [-OperationId <String>]
    [-DefaultProfile <PSObject>]
    [-AsJob]
    [-NoWait]
    [-WhatIf]
    [-Confirm]
    [<CommonParameters>]

Description

Queues an email message to be sent to one or more recipients

Examples

Example 1: Queues an email message to be sent to one or more recipients

$emailRecipientTo = @(
   @{
        Address = "abc@contoso.com"
        DisplayName = "abc"
    }
)

$message = @{
	ContentSubject = "Test Email"
	RecipientTo = @($emailRecipientTo)  # Array of email address objects
	SenderAddress = 'info@contoso.com'
	ContentPlainText = "This is the first email from ACS - HTML"
}

Send-AzEmailServicedataEmail -Message $Message -endpoint "https://contoso.unitedstates.communication.azure.com"
AdditionalInfo    :
Code              :
Detail            :
Id                : 1111c0de-899f-5cce-acb5-3ec493af3800
Message           :
ResourceGroupName :
RetryAfter        :
Status            : Succeeded
Target            :

Queues an email message to be sent to one or more recipients, above is the example with only required fields.

Example 2: Queues an email message to be sent to one or more recipients

$emailRecipientTo = @(
   @{
        Address = "abc@contoso.com"
        DisplayName = "abc"
    },
   @{
        Address = "def@contoso.com"
        DisplayName = "def"
    }
)

$fileBytes1 = [System.IO.File]::ReadAllBytes("<file path>")

$fileBytes2 = [System.IO.File]::ReadAllBytes("<image file path>")

$emailAttachment = @(
	@{
		ContentInBase64 = $fileBytes1
		ContentType = "<text/plain>"
		Name = "<test.txt>"
	},
	@{
		ContentInBase64 = $fileBytes2
		ContentType = "image/png"
		Name = "<inline-attachment.png>"
		contentId = "<inline-attachment>"
	}
)

$headers = @{
    "Key1" = "Value1"
    "Key2" = "Value2"
	"Importance" = "high"
}

$emailRecipientBcc = @(
   @{
        Address = "abc@contoso.com"
        DisplayName = "abc"
    }
)

$emailRecipientCc = @(
   @{
        Address = "abc@contoso.com"
        DisplayName = "abc"
    }
)

$emailRecipientReplyTo = @(
   @{
        Address = "abc@contoso.com"
        DisplayName = "abc"
    }
)

$message = @{
	ContentSubject = "Test Email"
	RecipientTo = @($emailRecipientTo)  # Array of email address objects
	SenderAddress = 'info@contoso.com'
	Attachment = @($emailAttachment) # Array of attachments
	ContentHtml = "<html><head><title>Enter title</title></head><body><img src='cid:inline-attachment' alt='Company Logo'/><h1>This is the first email from ACS - HTML</h1></body></html>"
	ContentPlainText = "This is the first email from ACS - HTML"
	Header = $headers  # Importance = high/medium/low or X-Priority = 2/3/4
	RecipientBcc = @($emailRecipientBcc) # Array of email address objects
	RecipientCc = @($emailRecipientCc) # Array of email address objects
	ReplyTo = @($emailRecipientReplyTo) # Array of email address objects
	UserEngagementTrackingDisabled = $true
}

Send-AzEmailServicedataEmail -Message $Message -endpoint "https://contoso.unitedstates.communication.azure.com"
AdditionalInfo    :
Code              :
Detail            :
Id                : 1111c0de-899f-5cce-acb5-3ec493af3801
Message           :
ResourceGroupName :
RetryAfter        :
Status            : Succeeded
Target            :

Queues an email message to be sent to one or more recipients, above is the example with all the fields.

Parameters

-AsJob

Run the command as a job

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Attachment

List of attachments. Please note that we limit the total size of an email request (which includes both regular and inline attachments) to 10MB.

Parameter properties

Type:

IEmailAttachment[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ClientRequestId

Tracking ID sent with the request to help with debugging.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Confirm

Prompts you for confirmation before running the cmdlet.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:cf

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ContentHtml

Html version of the email message.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ContentPlainText

Plain text version of the email message.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ContentSubject

Subject of the email message

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-DefaultProfile

The DefaultProfile parameter is not functional. Use the SubscriptionId parameter when available if executing the cmdlet against a different subscription.

Parameter properties

Type:PSObject
Default value:None
Supports wildcards:False
DontShow:False
Aliases:AzureRMContext, AzureCredential

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Endpoint

The communication resource, for example https://my-resource.communication.azure.com

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Header

Custom email headers to be passed.

Parameter properties

Type:Hashtable
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JsonFilePath

Path of Json file supplied to the Send operation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendViaJsonFilePath
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-JsonString

Json string supplied to the Send operation

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendViaJsonString
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-Message

Message payload for sending an email

Parameter properties

Type:IEmailMessage
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

Send
Position:Named
Mandatory:True
Value from pipeline:True
Value from pipeline by property name:False
Value from remaining arguments:False

-NoWait

Run the command asynchronously

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-OperationId

This is the ID provided by the customer to identify the long running operation. If an ID is not provided by the customer, the service will generate one.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecipientBcc

Email BCC recipients

Parameter properties

Type:

IEmailAddress[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecipientCc

Email CC recipients

Parameter properties

Type:

IEmailAddress[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-RecipientTo

Email To recipients

Parameter properties

Type:

IEmailAddress[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-ReplyTo

Email addresses where recipients' replies will be sent to.

Parameter properties

Type:

IEmailAddress[]

Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-SenderAddress

Sender email address from a verified domain.

Parameter properties

Type:String
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:True
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-UserEngagementTrackingDisabled

Indicates whether user engagement tracking should be disabled for this request if the resource-level user engagement tracking setting was already enabled in the control plane.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False

Parameter sets

SendExpanded
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Parameter properties

Type:SwitchParameter
Default value:None
Supports wildcards:False
DontShow:False
Aliases:wi

Parameter sets

(All)
Position:Named
Mandatory:False
Value from pipeline:False
Value from pipeline by property name:False
Value from remaining arguments:False

CommonParameters

This cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutBuffer, -OutVariable, -PipelineVariable, -ProgressAction, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters.

Inputs

IEmailMessage

Outputs

IEmailSendResult