嘿,我似乎无法使用 send_mail() 发送电子邮件,我不知道为什么。
这是我的详细信息
设置.py
EMAIL_HOST = 'localhost',
EMAIL_PORT = 25
我的观点
from django.core.mail import send_mail
send_mail('Subject here', 'Here is the message.', 'from@example.com',
['to@example.com'], fail_silently=False)
这失败并出现错误
getaddrinfo() argument 1 must be string or None
有人有想法么?
我正在 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>