I like to send scheduled emails in Django with Crontab. I made a very simple app to test how can I send an email in every minutes (just for testing purposes). I think I am doing something wrong, because I can't get the mails.
users/cron.py
from django.core.mail import send_mail
def my_scheduled_job():
send_mail(
'subject',
'Here is the message.',
'something@example.com',
['me@gmail.com'],
fail_silently=False,
)
print('Successfully sent')
settings.py
CRONJOBS = [
('*/1 * * * *', 'users.cron.my_scheduled_job')
]
I added the job like this:
python3 manage.py crontab add
then
python3 manage.py runserver
My mailing server configured fine, every other emails are sent, but I can't get these emails, nothing happens. I don't like to use Celery or Django Q.