执行返回结果信息:
In [16]: from django.core.mail import send_mail
In [17]: send_mail('Mydevops email','This is a test','sharkyun2017@126.com',['dockerhub@163.com'],fail_silently=False)
---------------------------------------------------------------------------
SMTPAuthenticationError Traceback (most recent call last)
<ipython-input-17-61d83710df4f> in <module>()
----> 1 send_mail('Mydevops email','This is a test','sharkyun2017@126.com',['dockerhub@163.com'],fail_silently=False)
/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/core/mail/__init__.pyc in send_mail(subject, message, from_email, recipient_list, fail_silently, auth_user, auth_password, connection, html_message)
60 mail.attach_alternative(html_message, 'text/html')
61
---> 62 return mail.send()
63
64
/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/core/mail/message.pyc in send(self, fail_silently)
301 # send to.
302 return 0
--> 303 return self.get_connection(fail_silently).send_messages([self])
304
305 def attach(self, filename=None, content=None, mimetype=None):
/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/core/mail/backends/smtp.pyc in send_messages(self, email_messages)
98 return
99 with self._lock:
--> 100 new_conn_created = self.open()
101 if not self.connection:
102 # We failed silently on open().
/home/shark/virtualenv/imoocc_py2.7/lib/python2.7/site-packages/django/core/mail/backends/smtp.pyc in open(self)
65 self.connection.ehlo()
66 if self.username and self.password:
---> 67 self.connection.login(self.username, self.password)
68 return True
69 except smtplib.SMTPException:
/usr/lib64/python2.7/smtplib.pyc in login(self, user, password)
619 # 235 == 'Authentication successful'
620 # 503 == 'Error: already authenticated'
--> 621 raise SMTPAuthenticationError(code, resp)
622 return (code, resp)
623
SMTPAuthenticationError: (535, 'Error: authentication failed')
【课程升级3.6版本】大牛全面践行DevOps,运维与开发间高效协作
了解课程