UsersMessages
class UsersMessages extends Resource (View source)
The "messages" collection of methods.
Typical usage is:
$gmailService = new Google\Service\Gmail(...);
$messages = $gmailService->users_messages;
Methods
Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all. (messages.batchDelete)
Modifies the labels on the specified messages. (messages.batchModify)
Immediately and permanently deletes the specified message. This operation
cannot be undone. Prefer messages.trash
instead. (messages.delete)
Gets the specified message. (messages.get)
Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. This method doesn't perform SPF checks, so it might not work for some spam messages, such as those attempting to perform domain spoofing. This method does not send a message. (messages.import)
Lists the messages in the user's mailbox. (messages.listUsersMessages)
Modifies the labels on the specified message. (messages.modify)
Sends the specified message to the recipients in the To
, Cc
, and Bcc
headers. For example usage, see Sending
email.
Moves the specified message to the trash. (messages.trash)
Details
batchDelete(string $userId, BatchDeleteMessagesRequest $postBody, array $optParams = [])
Deletes many messages by message ID. Provides no guarantees that messages were not already deleted or even existed at all. (messages.batchDelete)
batchModify(string $userId, BatchModifyMessagesRequest $postBody, array $optParams = [])
Modifies the labels on the specified messages. (messages.batchModify)
delete(string $userId, string $id, array $optParams = [])
Immediately and permanently deletes the specified message. This operation
cannot be undone. Prefer messages.trash
instead. (messages.delete)
Message
get(string $userId, string $id, array $optParams = [])
Gets the specified message. (messages.get)
Message
import(string $userId, Message $postBody, array $optParams = [])
Imports a message into only this user's mailbox, with standard email delivery scanning and classification similar to receiving via SMTP. This method doesn't perform SPF checks, so it might not work for some spam messages, such as those attempting to perform domain spoofing. This method does not send a message. (messages.import)
Message
insert(string $userId, Message $postBody, array $optParams = [])
Directly inserts a message into only this user's mailbox similar to IMAP APPEND
, bypassing most scanning and classification. Does not send a message.
(messages.insert)
ListMessagesResponse
listUsersMessages(string $userId, array $optParams = [])
Lists the messages in the user's mailbox. (messages.listUsersMessages)
Message
modify(string $userId, string $id, ModifyMessageRequest $postBody, array $optParams = [])
Modifies the labels on the specified message. (messages.modify)
Message
send(string $userId, Message $postBody, array $optParams = [])
Sends the specified message to the recipients in the To
, Cc
, and Bcc
headers. For example usage, see Sending
email.
(messages.send)
Message
trash(string $userId, string $id, array $optParams = [])
Moves the specified message to the trash. (messages.trash)
Message
untrash(string $userId, string $id, array $optParams = [])
Removes the specified message from the trash. (messages.untrash)