我把以下内容放在我的settings.py文件中。该电子邮件地址有一个测试。我发现从Webfaction的网站上的电子邮件设置:为什么我的send_mail()命令在Django中不起作用?
EMAIL_HOST = 'smtp.webfaction.com'
EMAIL_HOST_USER = 'hekevintran_test'
EMAIL_HOST_PASSWORD = 'testpass'
EMAIL_PORT = 465
EMAIL_USE_TLS = True
这是我的文件看起来是这样的:
from django.core.mail import send_mail
send_mail(subject='subject',
message='message',
from_email='[email protected]',
recipient_list=['[email protected]'],
fail_silently=False)
当我运行它上面摊位很长一段时间,然后给了我这个错误:
SMTPServerDisconnected: Connection unexpectedly closed
我在做什么错?
您的建议工作。谢谢! – hekevintran 2009-04-11 01:16:37