Skip to content

Message

Jeremy Ephron Barenholtz edited this page Sep 13, 2020 · 1 revision
simplegmail.Message(self, service, user_id, msg_id, thread_id, recipient, sender, subject, date, snippet, plain=None, html=None, label_ids=None, attachments=None)

The Message class for emails in your Gmail mailbox. This class should not be manually constructed. Contains all information about the associated message, and can be used to modify the message's labels (e.g., marking as read/unread, archiving, moving to trash, starring, etc.).

Parameters:

  • service: googleapiclient.discovery.Resource
    The Gmail service object.
  • user_id: str
    The username of the account the message belongs to.
  • msg_id: str The message id.
  • thread_id: str
    The thread id.
  • recipient: str
    Who the message was addressed to.
  • sender: str
    Who the message was sent from.
  • subject: str
    The subject line of the message.
  • date: str
    The date the message was sent.
  • snippet: str
    The snippet line for the message.
  • plain: str
    The plaintext contents of the message. Default None.
  • html: str
    The HTML contents of the message. Default None.
  • label_ids: List[str]
    The ids of labels associated with this message. Default [].
  • attachments: List[Attachment]
    A list of attachments for the message. Default [].
Clone this wiki locally