Trying to send email message using python's smtplib via gmail:
import smtplib
msg = "\r\n".join([
"From: " + email_host,
"To: " + email_recipient,
"Subject: subject",
"",
email_msg
])
server = smtplib.SMTP('smtp.gmail.com:587')
server.ehlo()
server.starttls()
server.login(email_host, email_pwd)
server.sendmail(email_host, email_recipient, msg)
server.quit()
For popular services such as yandex, yahoo and gmail it works perfect. But it's impossible to send a message to domain-based emails (login@some_domain.com).
What's the problem?