Skip to content

Instantly share code, notes, and snippets.

@israel-dryer
Created December 28, 2020 17:50
Show Gist options
  • Save israel-dryer/3cda283314dafde43e13872066db8f10 to your computer and use it in GitHub Desktop.
Save israel-dryer/3cda283314dafde43e13872066db8f10 to your computer and use it in GitHub Desktop.
example of find a word in a subject line then performing action; then stopping.
search_term = "product"
for message in inbox.Items:
if search_term in message.Subject:
do_something()
break # this will break out of the loop once the item is found
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment