Nicolas, thanks for help. I'm glad and proud to state I've discovered the cause of the problem myself - the problem was SMTP (or maybe the recipient's side) on hosting has been configured to reject any message without sender's address. Using send_mail with specifying sender explicitly solved my problem.
понедельник, 16 июля 2012 г., 16:39:52 UTC+4 пользователь Nicolas Emiliani написал: > > > > On Mon, Jul 16, 2012 at 4:05 AM, Andrejus <andrius.momzya...@gmail.com>wrote: > >> I've got a Django instance (1.4, python 2.7.2) running via FastCGI on >> vds-hosting. >> The problem is: >> >> (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=['bla-...@bla-bla.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)') >> > > I would check a few things, first : > > What smtp server are you using ? > Did you configured your django app to use the SMTP server?, I think you > need to add some SMTP_ vars to your settings.py, > because otherwise you will end up using sendmail (if it's linux) and it > might be shutoff for security reasons. > > If you have an SMTP server in your hosting access it using TELNET and try > to send an email through the CLI interface > to check that it works correctly. > > Hope it helps. > > > >> >> When I tested e-mail sending on my PC with locally installed mail server >> I didn't have any problem, mailing worked well. >> Please anybody help. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "Django users" group. >> To view this discussion on the web visit >> https://groups.google.com/d/msg/django-users/-/pI8qXk50AaEJ. >> To post to this group, send email to django-users@googlegroups.com. >> To unsubscribe from this group, send email to >> django-users+unsubscr...@googlegroups.com. >> For more options, visit this group at >> http://groups.google.com/group/django-users?hl=en. >> > > > > -- > Nicolas Emiliani > > Lo unico instantaneo en la vida es el cafe, y es bien feo. > -- You received this message because you are subscribed to the Google Groups "Django users" group. To view this discussion on the web visit https://groups.google.com/d/msg/django-users/-/ivb5Ws9yLqgJ. To post to this group, send email to django-users@googlegroups.com. To unsubscribe from this group, send email to django-users+unsubscr...@googlegroups.com. For more options, visit this group at http://groups.google.com/group/django-users?hl=en.