Skip to content

Commit

Permalink
Merge pull request #6 from b-diggity/outlook-update
Browse files Browse the repository at this point in the history
Added option to pass creds
  • Loading branch information
b-diggity authored Mar 21, 2021
2 parents b08fb81 + 189c74f commit fd784c7
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 4 deletions.
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@

setup(
name="utilities",
version="0.0.1",
version="0.0.3",
author="b-diggity",
description="Utilities to include in Python scripts",
long_description=readme,
Expand Down
13 changes: 10 additions & 3 deletions utilities/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,9 +7,16 @@


# Function for sending emails via outlook
def email_outlook(message: str = None, subject: str = None):
mail_user = os.getenv('MAIL_USER_OUTLOOK')
mail_key = os.getenv('MAIL_PASS_OUTLOOK')
def email_outlook(
message: str = None,
subject: str = None,
username: str = None,
password: str = None
):
if username is None:
mail_user = os.getenv('MAIL_USER_OUTLOOK')
if password is None:
mail_key = os.getenv('MAIL_PASS_OUTLOOK')
mail_server = "smtp-mail.outlook.com"

body = MIMEText(f'{message}\n\nNotification Autobot')
Expand Down

0 comments on commit fd784c7

Please sign in to comment.