# Send Email - [Note](#note) - [API documentation](#api-documentation) - [Definitions](#definitions) - [Use Gmail API to send messages](#use-gmail-api-to-send-messages) - [Use SMTP to send messages](#use-smtp-to-send-messages) - [Google Workspace SMTP relay service](#google-workspace-smtp-relay-service) - [Send an email](#send-an-email) - [Send an email from a user sendas](#send-an-email-from-a-user-sendas) - [Send an email from a group](#send-an-email-from-a-group) - [Send an email to notify a person of their new Google Workspace account](#send-an-email-to-notify-a-person-of-their-new-google-workspace-account) - [Send an email from users](#send-an-email-from-users) - [Send an email to users](#send-an-email-to-users) - [Simple `replace ` processing](Tag-Replace) - [Example](#example) ## Note Thanks to @bousquf for the following enhancement. You want to send a message from an authorized group but a group email address can't be used in the Gmail API as the sender. Alternatively, you want to send a message from a user's alternate sendas address. Added the option `mailbox ` to `gam sendemail` to allow specifying the sender email address used in the Gmail API as different from `from `. ## API documentation * [Gmail API - Messages](https://developers.google.com/gmail/api/v1/reference/users/messages) * [Send Email from Printer/Scanner](https://support.google.com/a/answer/176600) ## Definitions * [Command data from Google Docs/Sheets/Storage](Command-Data-From-Google-Docs-Sheets-Storage) ``` ::= See: https://docs.python.org/3/library/re.html ::= ::= ::= > ::= (.)+ ::= @ | <@> # The outer <> around @ are literal, e.g., IT Group ::= "(,)*" ::= | | See: https://github.com/GAM-team/GAM/wiki/Collections-of-Users ::= | (select ) ::= || ::= ::= ::= https://storage.cloud.google.com//| https://storage.googleapis.com//| gs:///| / ::= ||( ) ::= (message|textmessage|htmlmessage )| (file|textfile|htmlfile [charset ])| (gdoc|ghtml )| (gcsdoc|gcshtml ) ``` ```