drownload
drownload

Reputation: 3

Send mail *without* mail queue in Django

Im using django_yubin to send mails via its mail queue.

However, there are a few instances where I want to send the mail immediately without putting it on the queue.

For example, when a user registers or resets their password. Or certain admin emails.

I tried using Django's built in email system by

from django.core.mail import send_mail as send_mail_core

and then using the send_mail_core() function.

This didnt work - looks like the send_mail in django.core.mail gets overridden by yubin

Thanks for your help

Upvotes: 0

Views: 458

Answers (1)

iklinac
iklinac

Reputation: 15758

Why would you even try to use send_mail_core if you can select the mail backend inside of send_mail function

def send_mail(subject, message, from_email, recipient_list,
          fail_silently=False, auth_user=None, auth_password=None,
          connection=None, html_message=None):

connection: The optional email backend to use to send the mail. If unspecified, an instance of the default backend will be used. See the documentation on Email backends for more details.

Upvotes: 1

Related Questions