## gmail.ServiceAccount


A service account sends as [subject](Message.md#epistole.Message.subject) through domain-wide delegation.


Usage

``` python
gmail.ServiceAccount(
    path,
    subject,
)
```


A Workspace administrator grants the service account's client ID the `https://www.googleapis.com/auth/gmail.send` scope. Inside [smtp.OAuth](smtp.OAuth.md#epistole.smtp.OAuth), it requests `https://mail.google.com/` instead, so the administrator grants that.


## Attributes


`path: Path`  
The service account's JSON key file. [connect()](Backend.md#epistole.Backend.connect) reads it.

`subject: str`  
The mailbox the service account acts as.
