Trying to send mails from website

15 views
Skip to first unread message

Divash Singh

unread,
May 1, 2020, 10:34:11 AM5/1/20
to django...@googlegroups.com

Hi guys,

 

I am using Celery and Eventlet to facilitate a task which sends emails.  I am using the following code:

 

@task

def order_created(order_id):

    """

    Task to send an e-mail notification when an order is

    successfully created.

    """

    order = Order.objects.get(id=order_id)

    subject = 'Order nr. {}'.format(order.id)

    message = 'Dear {},\n\nYou have successfully placed an order.\

                    Your order id is {}.'.format(order.first_name,

                                                 order.id)

    mail_sent = send_mail(subject,message,settings.EMAIL_HOST_USER,[order.email],fail_silently=False)

   

 

    return mail_sent

 

I get the following error

 

TypeError: wrap_socket() got an unexpected keyword argument '_context'

 

Can anyone assist?

I am using Python 3.8

Celery 4.4.2

Eventlet 0.25.2

Django 2.2.12

 

 

Sent from Mail for Windows 10

 

VenkataSivaRamiReddy

unread,
May 1, 2020, 2:58:41 PM5/1/20
to django...@googlegroups.com
Don't use function names like that _ 

--
You received this message because you are subscribed to the Google Groups "Django users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to django-users...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/django-users/5eac332b.1c69fb81.a319b.4b21%40mx.google.com.
Reply all
Reply to author
Forward
0 new messages