Update app.py
Browse files
app.py
CHANGED
|
@@ -1,19 +1,18 @@
|
|
| 1 |
-
|
|
|
|
| 2 |
|
| 3 |
-
|
| 4 |
-
connection = get_connection()
|
| 5 |
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
email = request.POST.get('email')
|
| 11 |
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
|
|
|
| 1 |
+
import os
|
| 2 |
+
from django.core.mail import send_mail
|
| 3 |
|
| 4 |
+
from django.conf import settings
|
|
|
|
| 5 |
|
| 6 |
+
settings.configure(
|
| 7 |
+
EMAIL_BACKEND='django.core.mail.backends.console.EmailBackend',
|
| 8 |
+
# You can also add other settings like this
|
| 9 |
+
)
|
|
|
|
| 10 |
|
| 11 |
+
# Now Django knows where to find the settings
|
| 12 |
+
send_mail(
|
| 13 |
+
subject='Test Email',
|
| 14 |
+
message='This is a test email.',
|
| 15 |
+
from_email='from@hoof.icom',
|
| 16 |
+
recipient_list=['ssuujjooyysujoy@outlook.com'],
|
| 17 |
+
fail_silently=False,
|
| 18 |
+
)
|