Форум сайта python.su
Проблема в следующем:
(mypython)-bash-4.1$ python manage.py shell Python 2.7.2 (default, Dec 8 2011, 12:06:29) [GCC 4.4.4 20100726 (Red Hat 4.4.4-13)] on linux2 Type "help", "copyright", "credits" or "license" for more information. (InteractiveConsole) >>> import django >>> from django.core.mail import EmailMessage >>> email = EmailMessage('Hello', 'World', to=['*****@******.ru']) >>> email.send() Traceback (most recent call last): File "<console>", line 1, in <module> File "/home/vhosts/e-pyfan.com/private/mypython/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/core/mail/message.py", line 248, in send return self.get_connection(fail_silently).send_messages([self]) File "/home/vhosts/e-pyfan.com/private/mypython/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/core/mail/backends/smtp.py", line 92, in send_messages sent = self._send(message) File "/home/vhosts/e-pyfan.com/private/mypython/lib/python2.7/site-packages/Django-1.4-py2.7.egg/django/core/mail/backends/smtp.py", line 110, in _send email_message.message().as_string()) File "/opt/python27/lib/python2.7/smtplib.py", line 728, in sendmail raise SMTPDataError(code, resp) SMTPDataError: (554, 'mail server permanently rejected message (#5.3.0)')
Офлайн
Разобрался!
надо указывать адрес, от которого посылается сообщение, иначе начинаются происки антиспамового фильтра!
Такая конструкция
send_mail('test1','test message','bla-bla@bla-bla.com', ['*******@yandex.ru'], fail_silently=False)
Офлайн