Search - User list
Full Version: Emails not being sent
Root » Bugs » Emails not being sent
1 2 3
divkis01
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
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
divkis01
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
divkis01

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
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
divkis01
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
slav0nic
as u planing sending mail without smtp ?)
and don't edit setting.py, u must used local_settings.py
divkis01
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
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
divkis01
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
This is a "lo-fi" version of our main content. To view the full version with more information, formatting and images, please click here.
Powered by DjangoBB