This document explains how to configure send-as aliases and email signatures in Gmail API.
Send-as aliases represent the email addresses from which an account can send mail. Each account always has at least one alias that represents the primary email address of the account.
Send-as aliases correspond to the "Send mail as" feature in the Gmail web interface.
Aliases are also used to manage signatures for an account. You must have a basic understanding of send-as aliases to change email signatures.
For information about how to
create,
list,
get,
update,
or delete
aliases, see the
settings.SendAs
resource.
Create and verify aliases
You must create aliases before you use them. In some cases, users must also verify ownership of the alias.
If Gmail requires user verification for an alias, the alias is returned
with a
VerificationStatus
of pending. A verification message is automatically sent to the target email
address. The owner of the email address must complete the verification process
before they can use it.
Aliases that don't require verification have a verification status of
accepted.
Use the
settings.sendAs.verify
method to resend the verification request if needed.
SMTP settings
Aliases for external addresses should send mail through a remote SMTP mail
sending agent (MSA). To configure the SMTP MSA for an alias, use the
smtpMsa
field to provide the connection details.
Manage signatures
You can also configure email signatures for each alias. The following code samples show how to set the signature for the user's primary address: