我被要求向使用 Django/Python 框架實現的現有程序添加一個功能。此功能將允許用戶單擊按鈕,該按鈕將顯示一個小對話框/表單以輸入值。我確實寫了一些代碼來顯示電子郵件已發送的消息,但實際上,它沒有發送!我的代碼:from django.shortcuts import renderfrom django.core.mail import send_mail# Create your views here.def index(request): send_mail('Request for a Clause', 'This is an automated email. Jeff, please submit the case for 1234567', '[email protected]', ['[email protected]'], fail_silently=False) return render(request, 'send/index.html')在項目根目錄中,setting.py我添加了 SMTP 配置:EMAIL_HOST = 'mail.mycompany.com'EMIAL_PORT = 587#EMAIL_HOST_USER = '[email protected]' ;no need it is on the white list#EMAIL_HOST_PASSWORD = '' ;no need it is on the white listEMAIL_USE_TLS = TrueEMAIL_USE_SSL = False我通過鍵入來運行它:python manage.py SendEmailApp我在這里缺少什么?
添加回答
舉報
0/150
提交
取消