(sender, to, subject, msgHtml, msgPlain, attachmentFile=None)
| 35 | |
| 36 | |
| 37 | def SendMessage(sender, to, subject, msgHtml, msgPlain, attachmentFile=None): |
| 38 | credentials = get_credentials() |
| 39 | http = credentials.authorize(httplib2.Http()) |
| 40 | service = discovery.build("gmail", "v1", http=http) |
| 41 | if attachmentFile: |
| 42 | message1 = createMessageWithAttachment( |
| 43 | sender, to, subject, msgHtml, msgPlain, attachmentFile |
| 44 | ) |
| 45 | else: |
| 46 | message1 = CreateMessageHtml(sender, to, subject, msgHtml, msgPlain) |
| 47 | result = SendMessageInternal(service, "me", message1) |
| 48 | return result |
| 49 | |
| 50 | |
| 51 | def SendMessageInternal(service, user_id, message): |
no test coverage detected