Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to create a draft email #115

Open
kishoreKunisetty opened this issue May 25, 2024 · 1 comment
Open

How to create a draft email #115

kishoreKunisetty opened this issue May 25, 2024 · 1 comment

Comments

@kishoreKunisetty
Copy link

i can see send and read emails but i'm not able to find how to write drafts using this package. if anyone is aware of this implementation please help me with it.

@psresnik
Copy link

I don't see any ability to create drafts in the simplegmail package. However, its Gmail class contains the service object for the Gmail API, and it looks like one should be able to do this as in https://stackoverflow.com/questions/46170469/gmail-api-create-draft-reply:

msg = create_message('YOU@gmail.com','THEM@company.com','Re: Some Subject','This is a test')
create_draft(service,'me',  msg)

which makes use of the code at https://developers.google.com/gmail/api/guides/drafts#python.

I have not tried this myself yet but thought I'd share what I found.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants