[Chicago] Getting Pinax to send mail

Jonathan Hayward christos.jonathan.hayward at gmail.com
Sun Jul 22 05:22:23 CEST 2012


On Sat, Jul 21, 2012 at 10:00 PM, Adam "Cezar" Jenkins <
emperorcezar at gmail.com> wrote:

>
>
> On Sat, Jul 21, 2012 at 9:49 PM, Jonathan Hayward <
> christos.jonathan.hayward at gmail.com> wrote:
>
>> I'm trying to get my Pinax project to send mail by connecting to 10.0.0.1
>> port 25 (I have hand-tested that I can send emails this way.)
>>
>>
> So we know that your SMTP service is working
>
>
>>  I have in my settings.py:
>>
>> DEFAULT_FROM_EMAIL = 'Orthodox Network <christos at pobox.com>'
>> EMAIL_BACKEND = 'django.core.mail.backends.smtp.EmailBackend'
>> EMAIL_HOST = '10.0.0.1'
>> EMAIL_HOST_USER = 'christos at pobox.com'
>> EMAIL_HOST_PASSWORD = ''
>>  EMAIL_PORT = 25
>> EMAIL_USE_TLS = False
>> EMAIL_SUBJECT_PREFIX = '[Orthodox Network]'
>>
>>
>> The email backend is quoted from web snippets, but I think my 0.7 project
>> is out of sync with the EMAIL_BACKEND.
>>
>
> Yea. There's nothing wrong with the above. Except you have an SMTP user
> set and not a password, from the docs, "If either of these settings is
> empty, Django won't attempt authentication".
>

Thanks.


>
>
>>
>> I can successfully import 'django.core.mail' from the virtualenv/python
>> manage.py shell, but I cannot import 'django.core.mail.backends', and a dir
>> on the imported module does not make it obvious where the EmailBackend
>> would have been moved to. I found a snippet at
>> http://djangosnippets.org/snippets/1864/ that looked promising--until I
>> looked at the imports and saw that it imports a submodule of
>> django.core.mail.backends.
>>
>
> Even in dev the backend hasn't moved according to the docs, so there is an
> issue there somehow. You might try digging into your site-packages and see
> whats in django/core/mail?
>
>

Thanks; I'll look there.

(Later)

Now it's importing it, oddly enough; I rebooted the server because one of
my alternatives bogged the server, and now, after making what should be a
mail entry, I get:

(virtual)Orthodox Network ~/orthodox $ python manage.py send_mail
/Users/jonathan/virtual/lib/python2.7/site-packages/pytz/__init__.py:32:
UserWarning: Module notification was already imported from
/Users/jonathan/virtual/lib/python2.7/site-packages/notification/__init__.pyc,
but /usr/local/Cellar/python/2.7/lib/python2.7/site-packages is being added
to sys.path
  from pkg_resources import resource_stream
/Users/jonathan/virtual/lib/python2.7/site-packages/pytz/__init__.py:32:
UserWarning: Module threadedcomments was already imported from
/Users/jonathan/virtual/lib/python2.7/site-packages/threadedcomments/__init__.pyc,
but /usr/local/Cellar/python/2.7/lib/python2.7/site-packages is being added
to sys.path
  from pkg_resources import resource_stream
------------------------------------------------------------------------
acquiring lock...
acquired.
releasing lock...
released.

0 sent; 0 deferred; 0 don't send
done in 0.01 seconds

But the password reset emails are getting in my inbox, including one from
the crontab send_mail instead of the command line invocation. I'm not clear
what fixed it, but thanks.


> Any suggestions on how I can make a python manage.py send_mail shoot over
>> the messages to the server?
>>
>> The following, from virtualenv/python manage.py shell, successfully sent
>> me a test message:
>>
>> >>> from django.core.mail import send_mail
>> >>> send_mail('Subject here', 'Here is the message.',
>> ... 'jonathan.hayward at pobox.com', ['christos at pobox.com'], fail_silently
>> = False)
>> 1
>>
>>
>> And a password reset with an EMAIL_BACKEND of
>> 'django.core.mail.send_mail' / 'django.core.mail' didn't leave anything in
>> my inbox.
>>
>> What should I do?
>>
>> --
>> [image: Christos Jonathan Hayward] <http://jonathanscorner.com/>
>> Christos Jonathan Hayward, an Orthodox Christian author.
>>
>> *Amazon <http://amazon.com/author/cjshayward>* • Author Bio<http://jonathanscorner.com/author/>
>>  • *Email <christos.jonathan.hayward at gmail.com>* • Facebook<http://www.facebook.com/christos.jonathan.hayward>
>>  • Google Plus <http://jonathanscorner.com/plus> • *Kindle<http://stornge.com/amazon>
>> * • LinkedIn <http://www.linkedin.com/in/jonathanhayward> • Orthodox
>> Network <http://orthodox-network.com/> (Profile<http://orthodox-network.com/profiles/profile/cjshayward/>)
>> • Twitter <http://twitter.com/JonathansCorner> • *Web<http://jonathanscorner.com/>
>> * • What's New? <http://jonathanscorner.com/>
>> I invite you to visit my "theology, literature, and other creative works"
>> site. *See one page of my website! <http://random.jonathanscorner.com/>*
>>
>>
>> _______________________________________________
>> Chicago mailing list
>> Chicago at python.org
>> http://mail.python.org/mailman/listinfo/chicago
>>
>>
>
> _______________________________________________
> Chicago mailing list
> Chicago at python.org
> http://mail.python.org/mailman/listinfo/chicago
>
>


-- 
[image: Christos Jonathan Hayward] <http://jonathanscorner.com/>
Christos Jonathan Hayward, an Orthodox Christian author.

*Amazon <http://amazon.com/author/cjshayward>* • Author
Bio<http://jonathanscorner.com/author/>
 • *Email <christos.jonathan.hayward at gmail.com>* •
Facebook<http://www.facebook.com/christos.jonathan.hayward>
 • Google Plus <http://jonathanscorner.com/plus> •
*Kindle<http://stornge.com/amazon>
* • LinkedIn <http://www.linkedin.com/in/jonathanhayward> • Orthodox
Network<http://orthodox-network.com/>
 (Profile <http://orthodox-network.com/profiles/profile/cjshayward/>) •
Twitter <http://twitter.com/JonathansCorner> • *Web<http://jonathanscorner.com/>
* • What's New? <http://jonathanscorner.com/>
I invite you to visit my "theology, literature, and other creative works"
site. *See one page of my website! <http://random.jonathanscorner.com/>*
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/chicago/attachments/20120721/deaf4b3e/attachment.html>


More information about the Chicago mailing list