I’m trying to send emails by celery instead of the normal way to sending emails.
I use redis as a message broker technique,
I have install redis on specific server and I add those settings to my django app
CELERY_BROKER_URL = "redis://ip:6379"
CELERY_RESULT_BACKEND = "redis://ip:6379"
also I have create task for the celery to do,
from time import sleep
from celery import shared_task
from django.core.mail import send_mail
@shared_task()
def send_feedback_email_task(email_address, message):
"""Sends an email when the feedback form has been submitted."""
sleep(20) # Simulate expensive operation that freezes Django
send_mail(
"Your Feedback",
f"t{message}nnThank you!",
"[email protected]",
[email_address],
fail_silently=False,
)
in addition I have added all the email configuration,
the console doesn’t show any error, it shows that the task if successfully done, but the email never sent to the email_address
INFO/MainProcess] Task feedback.tasks.send_feedback_email_task[9bda58a9-c269-4c04-b4f0-10e7c41bbe22] received
and when I do redis-cli monitor
in server, the email appear in the console with the same body that I have wrote in the django app form
so why is the email not delivered ?
any help would be appreciated ..