Beispiel #1
0
SCOPES = 'https://mail.google.com/'
CLIENT_SECRET_FILE = 'client_secret.json'
APPLICATION_NAME = 'Gmail API Python Quickstart'
authInst = auth.auth(SCOPES, CLIENT_SECRET_FILE, APPLICATION_NAME)
credentials = authInst.get_credentials()

http = credentials.authorize(httplib2.Http())
service = discovery.build('gmail', 'v1', http=http)

my_file = open("file.txt", "r")

from datetime import date
today = '[%s]' % date.today().strftime('%d-%m-%Y')
print(today)

mssg = mesages.list_messages_matching_query(
    service, user_id="me", query='[foss-2017] Status Update ' + today)
#print (mssg)
print("This required")
#user_id = mssg[1]['id']
#print (user_id)

import send_email

today = '[%s]' % date.today().strftime('%d-%m-%Y')

print(today)

sendInst = send_email.send_email(service)
#message = sendInst.create_message_with_attachment('*****@*****.**','*****@*****.**','Hello_API',my_file.read(), 'image.jpg' )

message = sendInst.create_message('*****@*****.**',
Beispiel #2
0
APPLICATION_NAME = 'Gmail API Python Quickstart'
authInst = auth.auth(SCOPES,CLIENT_SECRET_FILE,APPLICATION_NAME)
credentials = authInst.get_credentials()

http = credentials.authorize(httplib2.Http())
service = discovery.build('gmail', 'v1', http=http)


my_file = open("file.txt", "r")

from datetime import date
today = '[%s]' % date.today().strftime('%d-%m-%Y')
print (today)


mssg=mesages.list_messages_matching_query(service, user_id="me", query='[foss-2017] Status Update ' + today)
#print (mssg)
print ("This required")
#user_id = mssg[1]['id']
#print (user_id)

import send_email

today = '[%s]'% date.today().strftime('%d-%m-%Y')

print (today)

sendInst = send_email.send_email(service)
#message = sendInst.create_message_with_attachment('*****@*****.**','*****@*****.**','Hello_API',my_file.read(), 'image.jpg' )

message = sendInst.create_message('*****@*****.**',