Skip to content

Commit

Permalink
Merge pull request #717 from TheHive-Project/Mailer_bugfix
Browse files Browse the repository at this point in the history
fix some code for python3 compatibility
  • Loading branch information
dadokkio authored Mar 19, 2020
2 parents 6131821 + b209fbd commit 6a54d84
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions responders/Mailer/mailer.py
Original file line number Diff line number Diff line change
Expand Up @@ -18,10 +18,10 @@ def run(self):
Responder.run(self)

title = self.get_param('data.title', None, 'title is missing')
title = title.encode('utf-8')
#title = title.encode('utf-8')

description = self.get_param('data.description', None, 'description is missing')
description = description.encode('utf-8')
#description = description.encode('utf-8')

mail_to = None
if self.data_type == 'thehive:case':
Expand Down Expand Up @@ -50,7 +50,8 @@ def run(self):
msg.attach(MIMEText(description, 'plain'))

s = smtplib.SMTP(self.smtp_host, self.smtp_port)
s.sendmail(self.mail_from, [mail_to], msg.as_string())
#s.sendmail(self.mail_from, [mail_to], msg.as_string())
s.send_message(msg, self.mail_from, [mail_to])
s.quit()
self.report({'message': 'message sent'})

Expand Down

0 comments on commit 6a54d84

Please sign in to comment.