Skip to content

Commit

Permalink
Only login if credentials supplied
Browse files Browse the repository at this point in the history
  • Loading branch information
nfultz committed Jan 15, 2019
1 parent a652748 commit 77ec25a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion nb2mail/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,9 @@ def postprocess(self, input):
smtpserver = smtplib.SMTP(self.smtp_addr,self.smtp_port)
smtpserver.ehlo()
smtpserver.starttls()
smtpserver.login(self.smtp_user, self.smtp_pass)

if self.smtp_user and self.smtp_pass:
smtpserver.login(self.smtp_user, self.smtp_pass)

with open(input) as f:
email = Parser().parse(f)
Expand Down

0 comments on commit 77ec25a

Please sign in to comment.