-
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
125 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -120,6 +120,24 @@ params = { | |
message = gmail.send_message(**params) # equivalent to send_message(to="[email protected]", sender=...) | ||
``` | ||
|
||
### Create a draft: | ||
|
||
```python | ||
from simplegmail import Gmail | ||
|
||
gmail = Gmail() # will open a browser window to ask you to log in and authenticate | ||
|
||
params = { | ||
"to": "[email protected]", | ||
"sender": "[email protected]", | ||
"subject": "My first email", | ||
"msg_html": "<h1>Woah, my first email!</h1><br />This is an HTML email.", | ||
"msg_plain": "Hi\nThis is a plain text email.", | ||
"signature": True # use my account signature | ||
} | ||
draft = gmail.create_draft(**params) # equivalent to create_draft(to="[email protected]", sender=...) | ||
``` | ||
|
||
It couldn't be easier! | ||
|
||
### Retrieving messages: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters