Rust
Gmail REST API Examples for Rust
OAuth2 Access Tokens
- Authorize a desktop application to use Gmail
- Refresh a Gmail OAuth access token
- Access a Google Workspace mailbox with a service account
- Check Gmail from a scheduled job after one-time consent
Sending Email and Drafts
- Send an email with the Gmail API
- Reply to a message in its existing Gmail thread
- Send a Gmail message with a file attachment
- Send email to blind-copy recipients with Gmail
- Create an unsent Gmail draft
- Insert an EML file into the Gmail inbox
Reading Messages
- List Gmail message IDs across all pages
- Search Gmail by sender, subject, date, or attachment
- Read selected headers for a page of Gmail messages
- Inspect the MIME parts of a Gmail message
- Download the original Gmail message as EML
- Download a Gmail attachment by ID
- Download a Gmail attachment by filename
- Synchronize Gmail message IDs and labels between runs
Labels, Trash and Deleting Messages
- List Gmail labels and their IDs
- Create a user label in Gmail
- Find a Gmail label ID by name
- Apply a Gmail label to search results in batches
- Mark a Gmail message as read or archive it
- Move one Gmail message to Trash
- Permanently delete one Gmail message