Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions src/assignmenttool/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -74,7 +74,8 @@ def mail_feedback(config, participants, pdfs):
email = participants.loc[user]['E-Mail']
except KeyError:
raise AToolError(f'Failed to look up name and email address for user "{user}".')
smtp.sendMessage(
try:
smtp.sendMessage(
sender = (config.mail_sender_name, config.mail_sender_address),
recipients = (name, email),
subject = config.mail_subject.replace('§§username§§', user).replace('§§name§§', name).replace('§§sheetnr§§', str(config.sheet)).replace('§§tutorname§§', config.tutor_name),
Expand All @@ -84,7 +85,10 @@ def mail_feedback(config, participants, pdfs):
},
bcc = config.mail_bcc
)
print(f'[OK]\t{user} -> {name} <{email}>')
print(f'[OK]\t{user} -> {name} <{email}>')
except Exception as e:
print("caught an exception from the SMTP server. Trying to continue rather than abort part way through sending.
print(e)

####################################################################################################

Expand Down