File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1313limitations under the License.
1414"""
1515# [START gmail_create_draft_with_attachment]
16-
1716from __future__ import print_function
1817
1918import base64
2019import mimetypes
2120import os
21+ from email .message import EmailMessage
2222from email .mime .audio import MIMEAudio
2323from email .mime .base import MIMEBase
2424from email .mime .image import MIMEImage
25- from email .mime .multipart import MIMEMultipart
2625from email .mime .text import MIMEText
27- from email .message import EmailMessage
2826
2927import google .auth
3028from googleapiclient .discovery import build
@@ -52,7 +50,7 @@ def gmail_create_draft_with_attachment():
5250 mime_message ['From' ] = 'gduser2@workspacesamples.dev'
5351 mime_message ['Subject' ] = 'sample with attachment'
5452
55- # text
53+ # text
5654 mime_message .set_content (
5755 'Hi, this is automated mail with attachment.'
5856 'Please do not reply.'
You can’t perform that action at this time.
0 commit comments