# eric7.EricNetwork.EricGoogleMail

Module implementing a dialog to send bug reports.

### Global Attributes

None

### Classes

EricGoogleMail | Class implementing the logic to send emails via Google Mail.

### Functions

GoogleMailHelp | Module function to get some help about how to enable the Google Mail OAuth2 service.

## EricGoogleMail

Class implementing the logic to send emails via Google Mail.

### Signals

sendResult(bool, str)
  emitted to indicate the transmission result and a result message

### Derived from

QObject

### Class Attributes

None

### Class Methods

None

### Methods

EricGoogleMail | Constructor
__doSendMessages | Private method to send all queued messages.
__loadCredentials | Private method to load credentials from the token file.
__prepareMessage | Private method to prepare the message for sending.
__saveCredentials | Private method to save credentials to the token file.
__startSession | Private method to start an authorized session and optionally execute the authorization flow.
sendMessage | Public method to send a message via Google Mail.

### Static Methods

None

#### EricGoogleMail (Constructor)

EricGoogleMail(parent=None)

Constructor

parent (QObject)
  reference to the parent object

#### EricGoogleMail.__doSendMessages

__doSendMessages()

Private method to send all queued messages.

#### EricGoogleMail.__loadCredentials

__loadCredentials()

Private method to load credentials from the token file.

Return:
  created credentials object

Return Type:
  Credentials

#### EricGoogleMail.__prepareMessage

__prepareMessage(message)

Private method to prepare the message for sending.

message (email.mime.text.MIMEBase)
  message to be prepared

Return:
  prepared message dictionary

Return Type:
  dict

#### EricGoogleMail.__saveCredentials

__saveCredentials(credentials)

Private method to save credentials to the token file.

credentials (Credentials)
  credentials to be saved

#### EricGoogleMail.__startSession

__startSession()

Private method to start an authorized session and optionally execute the authorization flow.

#### EricGoogleMail.sendMessage

sendMessage(message)

Public method to send a message via Google Mail.

message (email.mime.text.MIMEBase)
  email message to be sent

Up

## GoogleMailHelp

GoogleMailHelp()

Module function to get some help about how to enable the Google Mail OAuth2 service.

Return:
  help text

Return Type:
  str

Up