DjangoBB

Django based forum engine

  • You are not logged in.

#1 Nov. 16, 2010 11:28:59

divkis01
Registered: 2010-11-10
Posts: 9
Reputation: +  0  -
Profile   Send e-mail  

Emails not being sent

Hi,
I am trying to configure djangobb and I don't see the emails being sent. Elsewhere in the post people have pointed out that mails are logged in Database and they need to be sent explicitly either manually through

python manage.py send_mail

or using crontab. But I see that there are not messages in the messages_message table. I have checked it using sqlite3 and the following prints a blank output.
select * from messages_message

Also when I try to manually send it using the following send_mail I get the following output:

python2.6 manage.py send_mail
Unknown command: 'send_mail'
Type 'manage.py help' for usage.

Also I do have django mailer installed as shown below:


python2.6
Python 2.6.5 (r265:79063, May 12 2010, 10:28:19)
[GCC 4.1.2 20080704 (Red Hat 4.1.2-46)] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import mailer
>>> print mailer.__version__
0.1.0

I am not sure what is causing this, any help is appreciated.

Thanks in advance,
DivKis

Offline

#2 Nov. 16, 2010 13:10:39

slav0nic
DjangoBB Developer
From: Ukraine
Registered: 2009-10-25
Posts: 382
Reputation: +  5  -
Profile   Send e-mail  

Emails not being sent

rrr, goto -> http://djangobb.org/ and press Ctrl+F, find what django-mailer u needed
or find this info at http://hg.djangobb.org/djangobb/file/tip/optional-requirements.txt

Offline

#3 Nov. 16, 2010 16:36:54

divkis01
Registered: 2010-11-10
Posts: 9
Reputation: +  0  -
Profile   Send e-mail  

Emails not being sent

slav0nic
rrr, goto -> http://djangobb.org/ and press Ctrl+F, find what django-mailer u needed
or find this info at http://hg.djangobb.org/djangobb/file/tip/optional-requirements.txt


Hi Slav0nic,
I have now installed the exact versions as specified on the link send by you. Specifically

django-messages 0.4.4
whoosh 0.3.18
south 0.7.2

but I still have the same problem. I am quite new to python world, thus it seems to me that it could be some path issue or something similar. Please suggest how can I go about debugging it.

Thanks a lot for your reply,
DivKis01

Offline

#4 Nov. 16, 2010 17:00:04

divkis01
Registered: 2010-11-10
Posts: 9
Reputation: +  0  -
Profile   Send e-mail  

Emails not being sent


Hi Slav0nic,
I have now installed the exact versions as specified on the link send by you. Specifically

django-messages 0.4.4
whoosh 0.3.18
south 0.7.2

but I still have the same problem. I am quite new to python world, thus it seems to me that it could be some path issue or something similar. Please suggest how can I go about debugging it.

Thanks a lot for your reply,
DivKis01


Interestingly, the problem is somehow with how the django-mailer was installed. If I use easy_install django-mailer to install it, I get the same problems that this thread started with. But on downloading the tar.gz for django-mailer and then using python setup.py install, I can now call:

python2.6 manage.py send_mail

I am not sure why the way of installation should make any difference. Thanks to the thread on stackoverflow that helped me solved the problem:

http://stackoverflow.com/questions/1819524/how-to-use-django-mailer-without-pinax

Also somehow there are no mails to be sent but when I 'signup', it says that mail has been sent to you. I assume that it will queue it up somewhere (database probably?) and send it later.

python2.6 manage.py send_mail
/home/divkis01/lib/python2.6/django_registration-0.7-py2.6.egg/registration/models.py:4: DeprecationWarning: the sha module is deprecated; use the hashlib module instead
------------------------------------------------------------------------
acquiring lock...
acquired.
releasing lock...
released.

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


Any pointers,
Thanks a zillion for helping so far,
Divkis

Edited divkis01 (Nov. 16, 2010 17:01:49)

Offline

#5 Nov. 16, 2010 17:29:07

slav0nic
DjangoBB Developer
From: Ukraine
Registered: 2009-10-25
Posts: 382
Reputation: +  5  -
Profile   Send e-mail  

Emails not being sent

emm, show u settings.py
u synced db after install?

also u can disable django_mailer removing it from python or changed settings.py

and yes, mailer store emails at database, u can saw it in django admin panel and send by ./manage.py send_mail

Edited slav0nic (Nov. 16, 2010 17:32:14)

Offline

#6 Nov. 16, 2010 19:25:47

divkis01
Registered: 2010-11-10
Posts: 9
Reputation: +  0  -
Profile   Send e-mail  

Emails not being sent

slav0nic
emm, show u settings.py
u synced db after install?

also u can disable django_mailer removing it from python or changed settings.py

and yes, mailer store emails at database, u can saw it in django admin panel and send by ./manage.py send_mail


I tried after syncing the db and restarting the apache. But I see that no messages are being logged in database either by querying the db or from the admin panel.

FYI, Currently because I don't have smtp server etc installed on my local machine I am testing this by deploying to the host where I probably host my website. For security sake I am removing the following settings in my attached settings.py

EMAIL_HOST_USER = ''
EMAIL_HOST_PASSWORD = ''

Thanks,
DivKis

Attachments:
attachment settings.py (6.0 KB)

Offline

#7 Nov. 17, 2010 21:52:33

slav0nic
DjangoBB Developer
From: Ukraine
Registered: 2009-10-25
Posts: 382
Reputation: +  5  -
Profile   Send e-mail  

Emails not being sent

as u planing sending mail without smtp ?)
and don't edit setting.py, u must used local_settings.py

Offline

#8 Nov. 18, 2010 12:07:41

divkis01
Registered: 2010-11-10
Posts: 9
Reputation: +  0  -
Profile   Send e-mail  

Emails not being sent

slav0nic
as u planing sending mail without smtp ?)


Not sure of your question but no I am not trying to do anything special. Just trying to send mail using regular SMTP.

and don't edit setting.py, u must used local_settings.py


Sorry I am not sure what you mean here. By any chance did you find something wrong with my settings.py?

Thanks again,
Divkis

Offline

#9 Nov. 18, 2010 13:46:19

slav0nic
DjangoBB Developer
From: Ukraine
Registered: 2009-10-25
Posts: 382
Reputation: +  5  -
Profile   Send e-mail  

Emails not being sent

try send mail via console:

./manage.py shell


from django.core.mail import EmailMessage
email = EmailMessage('Subject', 'Body', t=['blabla@mail.com'])
email.save()


and read django docs about mail settings

Offline

#10 Nov. 23, 2010 14:47:53

divkis01
Registered: 2010-11-10
Posts: 9
Reputation: +  0  -
Profile   Send e-mail  

Emails not being sent

slav0nic
try send mail via console:

./manage.py shell

from django.core.mail import EmailMessage
email = EmailMessage('Subject', 'Body', t=['blabla@mail.com'])
email.save()


and read django docs about mail settings


Hi slav0nic,
thanks again for your response. I finally managed to configure my settings and now though the mail does go through but the problem is that it seems that it is sent immediately and is not logged in the database. Could it be because of the setting EMAIL_BACKEND='django.core.mail.backends.smtp.EmailBackend' instead of EMAIL_BACKEND = "mailer.backend.DbBackend"?

When I use the DbBackend, I get error that no module named backend in mailer.

Please suggest what might be going wrong.

Thanks,
DivKis

Offline

Board footer

Moderator control

Powered by DjangoBB

Lo-Fi Version