Re: Why am I getting an error when send e-mail from hosting?

210 views
Skip to first unread message

Nicolas Emiliani

unread,
Jul 16, 2012, 8:39:52 AM7/16/12
to django...@googlegroups.com


On Mon, Jul 16, 2012 at 4:05 AM, Andrejus <andrius....@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>
    return self.get_connection(fail_silently).send_messages([self])
    sent = self._send(message)
    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...@googlegroups.com.
To unsubscribe from this group, send email to django-users...@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.

Sergiy Khohlov

unread,
Jul 16, 2012, 11:41:44 AM7/16/12
to django...@googlegroups.com
good question contains answer:

SMTPDataError: (554, 'mail server permanently rejected message (#5.3.0)')

your SMTP reject your message

thanks
Serge

2012/7/16 Andrejus <andrius....@gmail.com>:
> 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
> написал:
> https://groups.google.com/d/msg/django-users/-/ivb5Ws9yLqgJ.
Reply all
Reply to author
Forward
0 new messages