Gmail
This Service lets you send email, compose drafts, manage labels, mark messages and threads, and conduct a variety of other Gmail account management tasks. See also Mail Service , a simpler service that only allows the sending of email.
Classes
Name | Brief description |
---|---|
Gmail
|
Provides access to Gmail threads, messages, and labels. |
Gmail
|
An attachment from Gmail. |
Gmail
|
A user-created draft message in a user's Gmail account. |
Gmail
|
A user-created label in a user's Gmail account. |
Gmail
|
A message in a user's Gmail account. |
Gmail
|
A thread in a user's Gmail account. |
Gmail
App
Methods
Method | Return type | Brief description |
---|---|---|
Gmail
|
Creates a draft email message. | |
Gmail
|
Creates a draft email message with optional arguments. | |
Gmail
|
Create a new user label of the given name. | |
Gmail
|
Deletes the specified label. | |
String[]
|
Gets a list of the emails that are set up as aliases for this account in Gmail. | |
Gmail
|
Retrieve an email message draft by ID. | |
Gmail
|
Retrieves all draft messages. | |
Gmail
|
Gets all Gmail draft messages. | |
Gmail
|
Retrieves all Inbox threads irrespective of labels. | |
Gmail
|
Retrieves a range of Inbox threads irrespective of labels. | |
Integer
|
Gets the number of unread threads in the inbox. | |
Gmail
|
Gets a message by ID. | |
Gmail
|
Retrieve all messages in the specified thread. | |
Gmail
|
Retrieve all messages in the specified threads. | |
Gmail
|
Retrieves all Priority Inbox threads irrespective of labels. | |
Gmail
|
Retrieves a range of Priority Inbox threads irrespective of labels. | |
Integer
|
Gets the number of unread threads in the Priority Inbox. | |
Gmail
|
Retrieves all spam threads irrespective of labels. | |
Gmail
|
Retrieves a range of spam threads irrespective of labels. | |
Integer
|
Gets the number of unread threads that are spam. | |
Gmail
|
Retrieves all starred threads irrespective of labels. | |
Gmail
|
Retrieves a range of starred threads irrespective of labels. | |
Integer
|
Gets the number of unread threads that are starred. | |
Gmail
|
Gets a thread by ID. | |
Gmail
|
Retrieves all trash threads irrespective of labels. | |
Gmail
|
Retrieves a range of trash threads irrespective of labels. | |
Gmail
|
Retrieves a label given the label name. | |
Gmail
|
Retrieves a list of user-created labels. | |
Gmail
|
Marks this message read and forces the message to refresh. | |
Gmail
|
Marks this message unread and forces the message to refresh. | |
Gmail
|
Marks these messages read and forces the messages to refresh. | |
Gmail
|
Marks these messages unread and forces the messages to refresh. | |
Gmail
|
Marks this thread as important and forces the thread to refresh. | |
Gmail
|
Marks this thread as read and forces the thread to refresh. | |
Gmail
|
Marks this thread as unimportant and forces the thread to refresh. | |
Gmail
|
Marks this thread unread and forces the thread to refresh. | |
Gmail
|
Marks these threads as important and forces the threads to refresh. | |
Gmail
|
Marks these threads as read and forces the threads to refresh. | |
Gmail
|
Marks these threads as unimportant and forces the threads to refresh. | |
Gmail
|
Marks these threads as unread and forces the threads to refresh. | |
Gmail
|
Moves the message to the trash and forces the message to refresh. | |
Gmail
|
Moves the specified messages to the trash and forces the messages to refresh. | |
Gmail
|
Moves this thread to the archive and forces the thread to refresh. | |
Gmail
|
Moves this thread to the inbox and forces the thread to refresh. | |
Gmail
|
Moves this thread to spam and forces the thread to refresh. | |
Gmail
|
Moves this thread to the trash and forces the thread to refresh. | |
Gmail
|
Moves these threads to the archive and forces the threads to refresh. | |
Gmail
|
Moves these threads to the inbox and forces the threads to refresh. | |
Gmail
|
Moves these threads to spam and forces the threads to refresh. | |
Gmail
|
Moves these threads to the trash and forces the threads to refresh. | |
Gmail
|
Reloads the message and associated state from Gmail (useful in case the labels, read state, etc., have changed). | |
Gmail
|
Reloads the messages and associated state from Gmail (useful in case the labels, read state, etc., have changed). | |
Gmail
|
Reloads the thread and associated state from Gmail (useful in case the labels, read state, etc., have changed). | |
Gmail
|
Reloads the threads and associated state from Gmail (useful in case the labels, read state, etc., have changed). | |
Gmail
|
Search Gmail with the given query. | |
Gmail
|
Search Gmail with the given query. | |
Gmail
|
Sends an email message. | |
Gmail
|
Sends an email message with optional arguments. | |
void
|
Sets the current message
access token
that enables the script to access the current Gmail
properties. |
|
Gmail
|
Adds a star to this message and forces the message to refresh. | |
Gmail
|
Adds stars to these messages and forces the messages to refresh. | |
Gmail
|
Removes a star from this message and forces the message to refresh. | |
Gmail
|
Removes stars from these messages and forces the messages to refresh. |
Gmail
Attachment
Methods
Method | Return type | Brief description |
---|---|---|
Blob
|
Returns a copy of this blob. | |
Blob
|
Return the data inside this object as a blob converted to the specified content type. | |
Byte[]
|
Gets the data stored in this blob. | |
String
|
Gets the content type of the bytes in this blob. | |
String
|
Gets the data of this blob as a String with UTF-8 encoding. | |
String
|
Gets the data of this blob as a string with the specified encoding. | |
String
|
Gets the SHA1 content hash for this attachment. | |
String
|
Gets the name of this blob. | |
Integer
|
Gets the size of this attachment. | |
Boolean
|
Returns whether this blob is a Google Workspace file (Sheets, Docs, etc.). | |
Blob
|
Sets the data stored in this blob. | |
Blob
|
Sets the content type of the bytes in this blob. | |
Blob
|
Sets the content type of the bytes in this blob based on the file extension. | |
Blob
|
Sets the data of this blob from a string with UTF-8 encoding. | |
Blob
|
Sets the data of this blob from a string with the specified encoding. | |
Blob
|
Sets the name of this blob. |
Gmail
Draft
Methods
Method | Return type | Brief description |
---|---|---|
void
|
Deletes this draft message. | |
String
|
Gets the ID of this draft message. | |
Gmail
|
Returns a GmailMessage representing this draft. | |
String
|
Returns the ID of the Gmail
representing this draft. |
|
Gmail
|
Sends this draft email message. | |
Gmail
|
Replaces the contents of this draft message. | |
Gmail
|
Replaces the contents of this draft message using optional arguments. |
Gmail
Label
Methods
Method | Return type | Brief description |
---|---|---|
Gmail
|
Adds this label to the given thread and forces the thread to refresh ( Gmail
). |
|
Gmail
|
Adds this label to the given threads and forces the threads to refresh. | |
void
|
Deletes this label. | |
String
|
Gets the id of this label. | |
String
|
Gets the name of this label. | |
Gmail
|
Gets the threads that are marked with this label. | |
Gmail
|
Gets a range of threads marked with this label. | |
Integer
|
Gets the number of unread threads tagged with this label. | |
Gmail
|
Removes this label from the given thread and forces the thread to refresh. | |
Gmail
|
Removes this label from the given threads and forces the threads to refresh. |
Gmail
Message
Methods
Method | Return type | Brief description |
---|---|---|
Gmail
|
Creates a draft message replying to the sender of this message using the reply-to address. | |
Gmail
|
Creates a draft message replying to the sender of this message using the reply-to address, with optional arguments. | |
Gmail
|
Creates a draft message replying to the sender using the reply-to address and all recipients of this message. | |
Gmail
|
Creates a draft message replying to the sender of this message using the reply-to address and all recipients, with optional arguments. | |
Gmail
|
Forwards this message to new recipients. | |
Gmail
|
Forwards this message to new recipients, with optional arguments. | |
Gmail
|
Gets all the attachments for this message. | |
Gmail
|
Gets all the attachments for this message. | |
String
|
Gets the comma-separated recipients bcc'd on this message. | |
String
|
Gets the HTML content of the body of this message. | |
String
|
Gets the comma-separated recipients cc'd on this message. | |
Date
|
Gets the date and time of this message. | |
String
|
Gets the sender of this message. | |
String
|
Gets the value of an RFC 2822 header given the header name. | |
String
|
Gets the ID of this message. | |
String
|
Gets the content of the body of this message without HTML formatting. | |
String
|
Gets the raw content of this message. | |
String
|
Gets the reply-to address of this message (usually the sender). | |
String
|
Gets the subject of this message. | |
Gmail
|
Gets the thread that contains this message. | |
String
|
Gets the comma-separated recipients of this message. | |
Boolean
|
Gets whether this message is a draft. | |
Boolean
|
Gets whether this message is a chat. | |
Boolean
|
Gets whether this message is in the inbox. | |
Boolean
|
Returns true
if this message is in the priority inbox; returns false
otherwise. |
|
Boolean
|
Gets whether this message is in the trash. | |
Boolean
|
Gets whether this message is starred. | |
Boolean
|
Gets whether this message is unread. | |
Gmail
|
Marks the message as read. | |
Gmail
|
Marks the message as unread. | |
Gmail
|
Moves the message to the trash. | |
Gmail
|
Reloads this message and associated state from Gmail (useful in case the labels, read state, etc., have changed). | |
Gmail
|
Replies to the sender of this message using the reply-to address. | |
Gmail
|
Replies to the sender of this message using the reply-to address, with optional arguments. | |
Gmail
|
Replies to the sender using the reply-to address and all recipients of this message. | |
Gmail
|
Replies to the sender of this message using the reply-to address and all recipients, with optional arguments. | |
Gmail
|
Stars the message. | |
Gmail
|
Unstars the message. |
Gmail
Thread
Methods
Method | Return type | Brief description |
---|---|---|
Gmail
|
Adds this label to the thread. | |
Gmail
|
Creates a draft message replying to the sender of the last message in this thread using the reply-to address. | |
Gmail
|
Creates a draft message replying to the sender of the last message in this thread using the reply-to address, with optional arguments. | |
Gmail
|
Creates a draft message replying to the sender of the last message in this thread, using the reply-to address and all recipients of this message. | |
Gmail
|
Creates a draft message replying to the sender of the last message in this thread, using the reply-to address and all recipients, with optional arguments. | |
String
|
Gets the subject of the first message in the thread. | |
String
|
Gets the ID of this thread. | |
Gmail
|
Returns the user-created labels on this thread. | |
Date
|
Gets the date of this thread's most recent message. | |
Integer
|
Returns the number of messages in the thread. | |
Gmail
|
Gets the messages in this thread. | |
String
|
Gets a permalink for this thread. | |
Boolean
|
Returns whether the thread has any starred messages. | |
Boolean
|
Returns whether the thread is marked as important. | |
Boolean
|
Returns whether the thread is labeled a chat. | |
Boolean
|
Returns whether the thread is in the inbox. | |
Boolean
|
Returns true if this thread is in the priority inbox; returns false otherwise. | |
Boolean
|
Returns whether the thread is marked as spam. | |
Boolean
|
Returns whether the thread is in the trash. | |
Boolean
|
Returns whether the thread has any unread messages. | |
Gmail
|
Marks this thread as important. | |
Gmail
|
Marks this thread as read. | |
Gmail
|
Marks this thread as unimportant. | |
Gmail
|
Marks this thread as unread. | |
Gmail
|
Moves this thread to the archive. | |
Gmail
|
Moves this thread to the inbox. | |
Gmail
|
Moves this thread to spam. | |
Gmail
|
Moves this thread to the trash. | |
Gmail
|
Reloads this thread, and associated state from Gmail (useful in case the labels, read state, etc., have changed). | |
Gmail
|
Removes this label from the thread. | |
Gmail
|
Reply to the sender of the last message on this thread using the replyTo address. | |
Gmail
|
Reply to the sender of the last message on this thread using the replyTo address, with optional arguments. | |
Gmail
|
Reply to the sender (using the replyTo address), and all recipients of the last message on this thread. | |
Gmail
|
Reply to the sender (using the reply
address), and all recipients of the last message
on this thread, with optional arguments. |