| smtp = smtplib.SMTP(self.server, self.port) | smtp = smtplib.SMTP(self.server, self.port) | ||||
| if self._use_tls: | if self._use_tls: | ||||
| smtp.starttls() | smtp.starttls() | ||||
| if (self.username): | |||||
| if self.username and self.password: | |||||
| smtp.login(self.username, self.password) | smtp.login(self.username, self.password) | ||||
| msg = MIMEMultipart() | msg = MIMEMultipart() | ||||
| msg['Subject'] = mail['subject'] | msg['Subject'] = mail['subject'] |