Method: users.settings.sendAs.create
创建自定义“发件人”别名。如果指定了 SMTP MSA,Gmail 会在创建别名之前尝试连接到 SMTP 服务以验证配置。如果别名需要进行所有权验证,系统会向该电子邮件地址发送一封邮件,并且资源的验证状态会设为 pending
;否则,系统将会创建该资源,并将验证状态设为 accepted
。如果提供了签名,Gmail 会在使用别名保存 HTML 前清理 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
有关详情,请参阅授权指南。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-05。
[null,null,["最后更新时间 (UTC):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"]]