devnamdev2003 commited on
Commit ·
4e10113
1
Parent(s): b9a06bd
up7
Browse files- api/views.py +3 -1
api/views.py
CHANGED
|
@@ -412,6 +412,7 @@ class ContactList1(CreateAPIView):
|
|
| 412 |
message = instance.message
|
| 413 |
|
| 414 |
try:
|
|
|
|
| 415 |
msg = MIMEMultipart()
|
| 416 |
msg["From"] = EMAIL_USER
|
| 417 |
msg["To"] = email
|
|
@@ -426,6 +427,7 @@ class ContactList1(CreateAPIView):
|
|
| 426 |
server.login(EMAIL_USER, EMAIL_PASSWORD)
|
| 427 |
|
| 428 |
server.sendmail(EMAIL_USER, email, msg.as_string())
|
|
|
|
| 429 |
|
| 430 |
admin_text = (
|
| 431 |
f"Subject: Form Submission from {name}\n\n"
|
|
@@ -436,7 +438,7 @@ class ContactList1(CreateAPIView):
|
|
| 436 |
)
|
| 437 |
|
| 438 |
server.sendmail(EMAIL_USER, "devnamdevcse@gmail.com", admin_text)
|
| 439 |
-
|
| 440 |
except Exception as e:
|
| 441 |
# ❗ Prevent worker crash
|
| 442 |
print("Email error:", e)
|
|
|
|
| 412 |
message = instance.message
|
| 413 |
|
| 414 |
try:
|
| 415 |
+
print("mail sending..")
|
| 416 |
msg = MIMEMultipart()
|
| 417 |
msg["From"] = EMAIL_USER
|
| 418 |
msg["To"] = email
|
|
|
|
| 427 |
server.login(EMAIL_USER, EMAIL_PASSWORD)
|
| 428 |
|
| 429 |
server.sendmail(EMAIL_USER, email, msg.as_string())
|
| 430 |
+
print("mail send to user")
|
| 431 |
|
| 432 |
admin_text = (
|
| 433 |
f"Subject: Form Submission from {name}\n\n"
|
|
|
|
| 438 |
)
|
| 439 |
|
| 440 |
server.sendmail(EMAIL_USER, "devnamdevcse@gmail.com", admin_text)
|
| 441 |
+
print("mail send to devnamdevcse@gmail.com")
|
| 442 |
except Exception as e:
|
| 443 |
# ❗ Prevent worker crash
|
| 444 |
print("Email error:", e)
|