I'm asked to add a feature to an existing program which is implemented using the Django/Python framework. This feature will allow the user to click on a button which it will show a small dialog/form to enter a value.
I did write some code which shows a message that the email is sent but in reality, it doesn't send it!
My code:
from django.shortcuts import render
from 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',
'akohan@mycompay.com',
['jjohnson@mycompany.com'],
fail_silently=False)
return render(request, 'send/index.html')
In the project root, in the setting.py
I have added SMTP configuration:
EMAIL_HOST = 'mail.mycompany.com'
EMIAL_PORT = 587
#EMAIL_HOST_USER = 'akohan@mycompany.com' ;no need it is on the white list
#EMAIL_HOST_PASSWORD = '' ;no need it is on the white list
EMAIL_USE_TLS = True
EMAIL_USE_SSL = False
I run it by typing:
python manage.py SendEmailApp
What am I missing here?