django发送电子邮件

dot*_*tty 1 email django send

干草,我似乎无法使用send_mail()发送电子邮件,我不知道为什么.

这是我的详细信息

settins.py

EMAIL_HOST = 'localhost',
EMAIL_PORT = 25
Run Code Online (Sandbox Code Playgroud)

我的看法

from django.core.mail import send_mail

send_mail('Subject here', 'Here is the message.', 'from@example.com',
    ['to@example.com'], fail_silently=False)
Run Code Online (Sandbox Code Playgroud)

这失败了,错误

getaddrinfo() argument 1 must be string or None
Run Code Online (Sandbox Code Playgroud)

有人有主意吗?

我正在开发OS X Leopard

继承人最后的追溯

/System/Library/Frameworks/Python.framework/Versions/2.5/lib/python2.5/smtplib.py in connect
for res in socket.getaddrinfo(host, port, 0, socket.SOCK_STREAM): ...
? Local vars
Variable    Value
host    ('localhost',)
msg     'getaddrinfo returns an empty list'
port    25
self    <smtplib.SMTP instance at 0x153b1e8>
Run Code Online (Sandbox Code Playgroud)

Ign*_*ams 8

后面的逗号EMAIL_HOST是使它成为长度为1的元组而不是字符串.删除流浪逗号.