A functional demo of the O365 Module to send an email on an authenticated, tokenized account.
- Create an app in Azure Developer’s portal (to do create visual steps)
- Create Secret, and copy tennant, client and secret (to do create visual steps)
- Load the python script, with dotenv, O365
- Can be imported or copied into your own scripts
- Usage is email(emailto, emailsubject, emailbody, emailfrom=’[email protected]‘, emailcc=None) _ * Where emailto is your intended recipient
- emailsubject is the email subject
- emailbody is the body of the email
- emailfrom is the email that it’s being sent from. Note that this account must be authorized.
- emailcc is the CC email address_
- On first usage, the script will give you a URL to paste into a browser. It will change the URL, and you must copy this back into the script for it to work. You will get a success message.