1

How can I flag a sent email to followup with a reminder date if possible using win32com python library, my code below does send the email, but does not create the followup reminder.

Code:

import win32com.client as win32   

outlook = win32.Dispatch('outlook.application')
mail = outlook.CreateItem(0)
#attachment1 = "x:\\report.htm"
attachment1 = "c:\\installAgent.log"
mail.Attachments.Add(Source=attachment1)
mail.To = "obama@hotmail.com"   
mail.Subject = "test"
mail.HtmlBody = '<h2>HTML Message body</h2>' #this field is optional
mail.FlagRequest = "Follow up";
mail.Display(True)
mail.send
Ossama
  • 2,401
  • 7
  • 46
  • 83
  • 1
    `.FlagRequest = "Follow up"` & `.FlagDueBy = DateAdd("d", 3, Date)` for due date 3 days from today – 0m3r Mar 07 '19 at 03:59
  • do you mind sharing the function Dateadd – Ossama Mar 07 '19 at 04:01
  • this is receipient receive follow up, how can i make this follow up for myself, i.e. the sender – Ossama Mar 07 '19 at 04:08
  • Oh, I mis-understood your question, try using reminderSet & reminderTime – 0m3r Mar 07 '19 at 04:30
  • I get the following error File "O365.py", line 12, in mail.reminderSet = "Follow up" File "C:\Python27\lib\site-packages\win32com\client\dynamic.py", line 581, in __setattr__ raise AttributeError("Property '%s.%s' can not be set." % (self._username_, attr)) tributeError: Property 'CreateItem.reminderSet' can not be set. – Ossama Mar 10 '19 at 23:59
  • managed to fix the issue below, but this is just creating a reminder, i would like to flag the item for followup- this then would show up in the tasks list – Ossama Mar 11 '19 at 00:16
  • by setting `mail.FlagRequest` and 'mail.FlagDueBy` after `mail.send`, does this fix the issue? – Peanut Butter Vibes Mar 13 '19 at 17:19

0 Answers0