Friday, January 31, 2014

Re: Problems Sending Email From Django SIte

Thank-you for your response...However, 

1. I can send email from the command line and from mutt.

2. I can send email from a python prompt using the settings.py in my app.

These two facts tell me the mail server is configured properly.

3. Only my django app cannot send email.

This fact leads me to believe my django app is mis-configured for sending email. In all other aspects, my app works as designed.

Do you have any other helpful suggestions?

Mark


On Fri, Jan 31, 2014 at 7:26 PM, m1chael <mykhul@gmail.com> wrote:
Your mail server needs configuring.

On Fri, Jan 31, 2014 at 8:15 PM, Mark Phillips
<mark@phillipsmarketing.biz> wrote:
> A follow up. After hitting send, I realized how to simulate an error - I
> asked for a page with a nonexistent id. Like the polls example in the django
> tutorial, I used an url with a poll_id that does not exist in my site. I got
> a Server Error (500) page, but no email. I looked in the exim4 reject log
> and found:
>
> 2014-01-31 18:07:04 unqualified recipient rejected: <a> H=localhost
> [127.0.0.1]
>
> I googled this error and have not had any luck figuring it out. Since I can
> send email from the command line and a python script with the same
> settings.py file as my site, could I be missing something in the django
> setup for sending emails to admins when there is a site error?
>
> All I have in settings.py for email is localhost, port 25, and admins email
> addresses. Do I need something else? Some module or middleware
> thing-a-ma-bob? I just have the stock modules and middleware that django
> created with a new project. I haven't found anything in the django docs that
> point to a module that I am missing.
>
> Thanks!
>
> Mark
>
>
> On Fri, Jan 31, 2014 at 6:06 PM, Mark Phillips <mark@phillipsmarketing.biz>
> wrote:
>>
>> I have my django site setup on my production server, a Debian machine with
>> exim4 and django 1.6. I use smtp.cox.net to relay my emails from my server.
>>
>> I can send emails from the server using mutt.
>>
>> I can also send an email from a python prompt in my virtual environment on
>> the server using this (with a different to and from address) after importing
>> my projects settings.py file:
>>
>> >>> from django.core.mail import send_mail
>> >>> send_mail('Subject here', 'Here is the message.', 'from@example.com',
>> >>> ['to@example.com'], fail_silently=False)
>>
>> However, when I get an error on the site (ie self-induced), I do not get
>> any emails from the site. I have ADMINS setup correctly per the docs. In
>> settings.py I just have the basics - localhost and port 25 for email.
>>
>> Perhaps the error I introduced was to severe (an import error is
>> settings.py). I also tried accessing a page that does not exist, and no
>> email.
>>
>> My first question: How can I simulate/force an error on the site to get an
>> email so I can make sure the site can send an email to the admins?
>>
>> Thanks,
>>
>> Mark
>>
>
> --
> You received this message because you are subscribed to the Google Groups
> "Django users" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to django-users+unsubscribe@googlegroups.com.
> To post to this group, send email to django-users@googlegroups.com.
> Visit this group at http://groups.google.com/group/django-users.
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/django-users/CAEqej2MLB-b7_cRZn7pEnCP1bTTm-zWuxyGC%3DK9UcZgMZq1pvw%40mail.gmail.com.
>
> For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAAuoY6PmcANqfwHVeuQ7WX82%3DkHJyziQsVOpN_Wrcc5hCYj%2BCQ%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users+unsubscribe@googlegroups.com.
To post to this group, send email to django-users@googlegroups.com.
Visit this group at http://groups.google.com/group/django-users.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/CAEqej2Oh2UKAic%3DS1FTNpsXaO474JrYzEH3Co%3DBPvpAMifEc5w%40mail.gmail.com.
For more options, visit https://groups.google.com/groups/opt_out.

No comments:

Post a Comment