python - Send email django from any host -


i have read plenty of links sending emails through django. i've tried of them don't work. tried sending email through python shell , '1'. - settings should use email work, i'm willing use mail server? - using gmail read causes problems, if i'm going use hotmail example need specify email password in settings.xml? - how debug problem?

this pure python code sending emails using smtp lib

from threading import thread import requests import time import smtplib def email_sender(input_message, email_to, client):     ''' function send email '''     = email_to     gmail_user = 'email of sender account'     gmail_pwd = 'password of sender account'     smtpserver = smtplib.smtp("smtp.gmail.com",587)     smtpserver.ehlo()     smtpserver.starttls()     smtpserver.ehlo     smtpserver.login(gmail_user, gmail_pwd)     header = 'to:' + + '\n' + 'from: ' + gmail_user + '\n' + 'subject:site down! \n'     input_message = input_message + client     msg = header + input_message     smtpserver.sendmail(gmail_user, to, msg)     smtpserver.close() 

Comments

Popular posts from this blog

Magento/PHP - Get phones on all members in a customer group -

php - .htaccess mod_rewrite for dynamic url which has domain names -

Website Login Issue developed in magento -