I've signed up in Microsoft live SMTP server and created an email for my django app to send mail from my domain. But the problem is these configurations doesn't work and I can not send email from my django app running on local host to another email address. What's wrong? This is my code:
#Settings.py
# Email Server config
DEFAULT_FROM_EMAIL = 'Hamid FzM <[email protected]>'
EMAIL_HOST = 'smtp.live.com'
EMAIL_PORT = 587
EMAIL_USE_TLS = True
EMAIL_HOST_USER = '[email protected]'
EMAIL_HOST_PASSWORD = 'something'
For testing purpose each time I visit 127.0.0.1/test/
an email will be send to my account by calling this function
#views
def test(request):
from django.core.mail import EmailMessage
EmailMessage('Test', 'This is body', to=['[email protected]'])