共用方式為


Send-AzEmailServicedataEmail

將電子郵件訊息排入佇列,以傳送給一或多個收件者

語法

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

Description

將電子郵件訊息排入佇列,以傳送給一或多個收件者

範例

範例 1:將電子郵件訊息排入佇列,以傳送給一或多個收件者

$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            :

將電子郵件訊息排入佇列,以傳送給一或多個收件者,以上是僅包含必要欄位的範例。

範例 2:將電子郵件訊息排入佇列,以傳送給一或多個收件者

$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            :

將電子郵件訊息排入佇列,以傳送給一或多個收件者,以上是包含所有欄位的範例。

參數

-AsJob

以作業身分執行命令

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Attachment

附件清單。 請注意,我們將電子郵件要求的總大小限製為10MB(包括一般和內嵌附件)。

類型:IEmailAttachment[]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ClientRequestId

使用要求傳送的追蹤標識碼,以協助偵錯。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Confirm

在執行 Cmdlet 之前,提示您進行確認。

類型:SwitchParameter
別名:cf
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ContentHtml

電子郵件訊息的 Html 版本。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ContentPlainText

電子郵件訊息的純文字版本。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-ContentSubject

電子郵件訊息的主旨

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-DefaultProfile

DefaultProfile 參數無法運作。 如果針對不同的訂用帳戶執行 Cmdlet,請使用 SubscriptionId 參數。

類型:PSObject
別名:AzureRMContext, AzureCredential
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-Endpoint

通訊資源,例如 https://my-resource.communication.azure.com

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Header

要傳遞的自訂電子郵件標頭。

類型:Hashtable
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-JsonFilePath

提供給傳送作業的 Json 檔案路徑

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-JsonString

提供給傳送作業的 Json 字串

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-Message

傳送電子郵件的訊息承載

類型:IEmailMessage
Position:Named
預設值:None
必要:True
接受管線輸入:True
接受萬用字元:False

-NoWait

以異步方式執行命令

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-OperationId

這是客戶提供的標識碼,用來識別長時間執行的作業。 如果客戶未提供標識碼,服務將會產生一個標識碼。

類型:String
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RecipientBcc

電子郵件密件抄送收件者

類型:IEmailAddress[]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RecipientCc

電子郵件副本收件者

類型:IEmailAddress[]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-RecipientTo

電子郵件收件者

類型:IEmailAddress[]
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-ReplyTo

將傳送收件者回復的電子郵件位址。

類型:IEmailAddress[]
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-SenderAddress

來自已驗證網域的發件者電子郵件位址。

類型:String
Position:Named
預設值:None
必要:True
接受管線輸入:False
接受萬用字元:False

-UserEngagementTrackingDisabled

指出是否已在控制平面中啟用資源層級的使用者參與追蹤設定,是否應該停用此要求的使用者參與追蹤。

類型:SwitchParameter
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

-WhatIf

顯示 Cmdlet 執行時會發生什麼事。 Cmdlet 未執行。

類型:SwitchParameter
別名:wi
Position:Named
預設值:None
必要:False
接受管線輸入:False
接受萬用字元:False

輸入

輸出