settings
SENDGRID_API_KEY = 'examplekey'
# EMAIL_BACKEND = 'sendgrid_backend.SendgridBackend'
EMAIL_HOST = 'smtp.sendgrid.net'
EMAIL_PORT = 587
EMAIL_HOST_USER = 'apikey'
EMAIL_HOST_PASSWORD = SENDGRID_API_KEY
EMAIL_USE_TLS = True
SENDGRID_SANDBOX_MODE_IN_DEBUG = False
view
Мне нужно отправить письмо с cinemacount12090@gmail.com' на email который указан в email = str(request.GET['email_input']).
messages = "Фільм: " +str(movie.name)+ "\nдата: " +str(session_date)+ "\nчас :" +str(time_sess.time)+ "\nзал №: " +str(hall_num.number_hall)+ "\nмісце: " +str(place_num)+ "\nряд: " +str(row_pl)+ "\nCектор: " +str(sector.name_sector)+ "\nЦіна: " +str(total_sum)+"\nчекаємо вас на сеанс!\n с повагою кінотеатр CINEMAX"
# print(messages)
send_mail(
'квиток на фільм',
messages,
'cinemacount12090@gmail.com',
[email],
fail_silently=False
)
при попытке отправить письмо
логи
2020-06-17T09:17:29.131010+00:00 app[web.1]: [80, 87, 86, 52, 37, 3, 41, 68, 16, 9, 44, 71, 60]
2020-06-17T09:17:29.131257+00:00 app[web.1]: 808786523734168169447160
2020-06-17T09:17:30.794140+00:00 heroku[router]: at=info method=GET path="/en/get_ticket/47/16695/38/?csrfmiddlewaretoken=PKZNIQZNHYBQ6xuUmqs1KMZvDTm0WrmXU1zgYDlCzju8LYapw4GMB9xbHvLEMFHY&email_input=reabko15%40gmail.com" host=cinemaxpro.herokuapp.com request_id=235e016e-fb08-4c87-a283-31ecfe99d22f fwd="176.120.62.210" dyno=web.1 connect=1ms service=1685ms status=500 bytes=402 protocol=https
2020-06-17T09:17:30.796415+00:00 app[web.1]: 10.9.82.245 - - [17/Jun/2020:12:17:30 +0300] "GET /en/get_ticket/47/16695/38/?csrfmiddlewaretoken=PKZNIQZNHYBQ6xuUmqs1KMZvDTm0WrmXU1zgYDlCzju8LYapw4GMB9xbHvLEMFHY&email_input=reabko15%40gmail.com HTTP/1.1" 500 145 "https://cinemaxpro.herokuapp.com/en/reservation_ticket/1/47/1/16695/1" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/83.0.4103.97 Safari/537.36"
буду рад любой помощи )