Does not send the letter from the form
settings.py
EMAIL_HOST = 'smtp.yandex.ru' EMAIL_HOST_USER = 'my mail' EMAIL_HOST_PASSWORD = 'password' EMAIL_PORT = 587 EMAIL_USE_TLS = True views.py
def get_data(request): if request.method == 'POST': form = MyForm(request.POST) if form.is_valid(): print('Hi') e_mail = send_mail('Заказ от {0}'.format(form.name), form.phone_number, 'my mail', ['to mail']) if e_mail == True: print(e_mail) return HttpResponseRedirect('/done/') else: return HttpResponse('<h1>Ошибка сообщение не отправлено<h1>') else: form = MyForm() return render(request, 'index.html', {'form':form}) C shell returns 1 when returning from a form from the site returns the following:
A server error occurred. Please contact the administrator.
and goes to this url:
/ done /
I work with poppy