In the Google API for python to send an email, https://developers.google.com/gmail/api/guides/sending you can find this method
def send_message(service, user_id, message):
try:
message = (service.users().messages().send(userId=user_id, body=message)
.execute())
print 'Message Id: %s' % message['id']
return message
except errors.HttpError, error:
print 'An error occurred: %s' % error
I am following that tutorial, and I have already followed another tutorial for getting the authentication, but my question is what to pass for this service variable. how to define it?
That page says nothing about it