Method: users.settings.sendAs.create
建立自訂「寄件者」寄件別名。如果已指定 SMTP MSA,Gmail 會在建立別名之前,嘗試連線至 SMTP 服務驗證設定。如果別名必須進行擁有權驗證,系統會將訊息傳送至該電子郵件地址,且資源的驗證狀態將設為 pending
;否則,系統會在建立資源時將驗證狀態設為 accepted
。如果提供簽名,Gmail 會先清理 HTML,再使用別名儲存。
這個方法僅適用於已委派全網域授權的服務帳戶用戶端。
HTTP 要求
POST https://gmail.googleapis.com/gmail/v1/users/{userId}/settings/sendAs
這個網址使用 gRPC 轉碼語法。
路徑參數
參數 |
userId |
string
使用者的電子郵件地址。特殊值「me」可用來表示已通過驗證的使用者。
|
回應主體
如果成功,回應主體會包含新建立的 SendAs
例項。
授權範圍
需要下列 OAuth 範圍:
https://www.googleapis.com/auth/gmail.settings.sharing
詳情請參閱授權指南。
除非另有註明,否則本頁面中的內容是採用創用 CC 姓名標示 4.0 授權,程式碼範例則為阿帕契 2.0 授權。詳情請參閱《Google Developers 網站政策》。Java 是 Oracle 和/或其關聯企業的註冊商標。
上次更新時間:2024-09-05 (世界標準時間)。
[null,null,["上次更新時間:2024-09-05 (世界標準時間)。"],[[["Creates a custom \"from\" send-as alias, requiring validation for SMTP MSAs and potentially ownership verification."],["Accessible only to service account clients with delegated domain-wide authority, using a specific HTTP POST request."],["Utilizes path parameters including `userId` to identify the user's email address, and requires a request body with a `SendAs` instance."],["Returns a `SendAs` instance in the response body upon successful alias creation."],["Needs authorization with the `https://www.googleapis.com/auth/gmail.settings.sharing` scope."]]],["This describes how to create a custom \"from\" send-as alias in Gmail using a `POST` request to the specified URL. The request includes a `userId` path parameter. The request body contains `SendAs` information, and the response will also be a `SendAs` instance. The creation process may involve SMTP validation and alias verification, setting the resource's verification status accordingly. It also sanitizes provided HTML signatures. This method is limited to service account clients with delegated domain-wide authority and requires a specific OAuth scope.\n"]]