Я прочитал с
http://www.packtpub.com/article/friends-via-email-social-web-application-django-1.0
и следуйте инструкциям:
=> И поменять мой
setting.py
SITE_HOST = '127.0.0.1:8000'
DEFAULT_FROM_EMAIL = 'KSO Publisher <soeng@xxxx.com.kh>'
EMAIL_HOST = 'smtp.xxxx.com.kh'
EMAIL_PORT = '25'
EMAIL_HOST_USER = 'myusernamea@xxxx.com.kh'
EMAIL_HOST_PASSWORD = 'mypassword'
EMAIL_USE_TLS = False
после того, как я иду в командную строку
python@python-desktop:~/workspace/kso$ python manage.py shell
Python 2.5.2 (r252:60911, Jul 22 2009, 15:35:03)
[GCC 4.2.4 (Ubuntu 4.2.4-1ubuntu3)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
(InteractiveConsole)
>>> from django.core.mail import send_mail
>>> emails = send_mail('Subject', 'Body of the message.','soeng@xxxx.com.kh',['pythonkhmer@gmail.com'])
Я получил сообщение об ошибке.
Traceback (most recent call last):
File "<console>", line 1, in <module>
File "/var/lib/python-support/python2.5/django/core/mail.py", line 345, in send_mail
connection=connection).send()
File "/var/lib/python-support/python2.5/django/core/mail.py", line 271, in send
return self.get_connection(fail_silently).send_messages([self])
File "/var/lib/python-support/python2.5/django/core/mail.py", line 166, in send_messages
new_conn_created = self.open()
File "/var/lib/python-support/python2.5/django/core/mail.py", line 131, in open
local_hostname=DNS_NAME.get_fqdn())
File "/usr/lib/python2.5/smtplib.py", line 244, in __init__
(code, msg) = self.connect(host, port)
File "/usr/lib/python2.5/smtplib.py", line 310, in connect
raise socket.error, msg
error: (110, 'Connection timed out')
Кто-нибудь знает, в чем именно проблема. И как я могу отправлять почту с помощью django framworks
Ссылка, которую я прочитал: