SHARE
TWEET

Untitled

a guest Jun 19th, 2019 55 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. import win32com.client as win32
  2.  
  3. outlook = win32.Dispatch("Outlook.Application").GetNamespace("MAPI")
  4.  
  5. outbox = outlook.GetDefaultFolder(6)
  6.  
  7. messages = messages = outbox.Items.restrict("[SentOn] > '5/31/2017 08:00 AM'")
  8.  
  9. for message in messages:
  10.     NewMsg = message.Forward()
  11.     NewMsg.To = "mail@mail.com"
  12.      
  13. import win32com.client as win32
  14.  
  15. outlook = win32.Dispatch("Outlook.Application").GetNamespace("MAPI")
  16.  
  17. outbox = outlook.GetDefaultFolder(6)
  18.  
  19. #try the restrict method!
  20. messages = outbox.Items.restrict("[SentOn] > '5/30/2017 12:00 AM'")
  21.  
  22. for message in messages:
  23.     print message
  24.      
  25. import win32com.client as win32
  26.  
  27. outlook = win32.Dispatch("Outlook.Application").GetNamespace("MAPI")
  28.  
  29. outbox = outlook.GetDefaultFolder(5)
  30.  
  31. messages = outbox.Items.restrict("[SentOn] > '5/30/2017 08:00 AM'")
  32.  
  33. for message in messages:
  34.     NewMsg = message.Forward()
  35.     NewMsg.Body = message.Body
  36.     NewMsg.Subject = message.Subject
  37.     NewMsg.To = "mail@mail.com"
  38.     NewMsg.Send()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top