import emails from emails.template import JinjaTemplate # message = emails.Message( # subject=JinjaTemplate(subject_template), # html=JinjaTemplate(html_template), # mail_from=(settings.EMAILS_FROM_NAME, settings.EMAILS_FROM_EMAIL), # ) message = f"test" subject = '註冊信' email_to ='doris@choozmo.com' # print('EEmail',email_to) message = emails.Message( subject=JinjaTemplate(message), html=JinjaTemplate(subject), mail_from=('zooey','zooey@choozmo.com'), ) smtp_options = {"host": "smtp.gmail.com", "port": "587"} smtp_options["tls"] = True #smtp_options["ssl"] = True smtp_options["user"] = 'zooey@choozmo.com' smtp_options["password"] = 'bnufmjzkyezputip' environment={} print(email_to,environment,smtp_options) response = message.send(to=email_to, render=environment, smtp=smtp_options) print('RResponse',response)