| 17 |
|
self.outlookApp = win32com.client.Dispatch("Outlook.Application") |
| 18 |
|
self.outlookEmailItem = 0x0 |
| 19 |
|
|
| 20 |
< |
def DraftEmail(self, emailTO, emailCC, emailSubject, emailBody, emailAttachment = None, bodyType = 'HTML'): |
| 21 |
< |
"""Easy way to draft an email and wont send""" |
| 20 |
> |
def DraftEmail(self, emailTO, emailCC, emailSubject, emailBody, emailAttachment = None, bodyType = 'HTML', finishType = 'Display', savePath = None): |
| 21 |
> |
"""Easy way to draft an email and wont send if you allow finishType as Display. Can be changed to OFT, to save it instead.""" |
| 22 |
|
newEmailMessage = self.outlookApp.CreateItem(self.outlookEmailItem) |
| 23 |
|
newEmailMessage.Subject = emailSubject |
| 24 |
|
newEmailMessage.GetInspector |
| 30 |
|
newEmailMessage.Cc = emailCC |
| 31 |
|
if emailAttachment: |
| 32 |
|
newEmailMessage.Attachments.Add(Source=emailAttachment) |
| 33 |
< |
newEmailMessage.Display() |
| 33 |
> |
if finishType == 'OFT': |
| 34 |
> |
newEmailMessage.SaveAs(savePath) |
| 35 |
> |
else: |
| 36 |
> |
newEmailMessage.Display() |
| 37 |
|
#newEmailMessage.send() |