Hi guys I'm writing a program to send and email from one email to another from the command line. Below is my program so far but I can't seem to get session.login(sender, password) to work. When I get rid of the "Try, except" function I get an error saying "SMTP AUTH extension not available on this server". I'm stuck and need help.
import smtplib
sender = raw_input("Please put in your e-mail")
password = raw_input("Email password please")
recipient = raw_input("Please put person e-mail")
message = raw_input("Insert message")
try:
session = smtplib.SMTP("smtp.gmail.com:587")
session.ehlo()
session.starttls
session.ehlo()
#having issues with this specific command
session.login(sender, password)
session.sendmail(sender, recipient, message)
session.quit
print("message sent :)")
except smtplib.SMTPException:
print("message not sent :(")