You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hey,
I send a email with celery, however, any exception like that:
GreenSSLSocket does not have a public constructor. Instances are returned by SSLContext.wrap_socket().
my code just is shown below:
I have the same issue. This seems like a Python 3.7 compatibility issue and being fixed in the master branch. Either use Python 3.6 or the master branch.
Hey,
I send a email with celery, however, any exception like that:
GreenSSLSocket does not have a public constructor. Instances are returned by SSLContext.wrap_socket().
my code just is shown below:
@celery_app.task
def send_mail(to, subject=None, content=None):
import smtplib
from email.mime.text import MIMEText
sender = "admin@xxx.vip"
passwd = "xxx"
status = {'status': None, 'info': None}
try:
msg = MIMEText(content, 'plain', 'utf-8')
msg['Subject'] = subject
msg['From'] = sender
msg['TO'] = to
smtp = smtplib.SMTP_SSL('smtp.qq.com', 465)
smtp.login(sender, passwd)
smtp.sendmail(sender, to, msg.as_string())
status.update(status='ok', info='send email successfully.')
except (Exception, ) as e:
print(e)
status.update(status='fail', info='send email fail, more:%s' % (e.__str__()))
return status
celery command:
$ celery worker -A celeryconfig -l info -P eventlet
if celery work with gevent lib(with option '-P gevent'), it's works!
i wanna to know what can i do, if i use celery with eventlet.
pip list show eventlet's version is 0.24.1
The text was updated successfully, but these errors were encountered: