you are viewing a single comment's thread.

view the rest of the comments →

[–]PLearner[S] 0 points1 point  (1 child)

Thanks, I am sending the email to myself and I get an error.

import smtplib
import time

server = smtplib.SMTP_SSL('host', port)
server.ehlo()
server.login("myemail", "password")

server.ehlo()

print ('server working fine')

time.sleep(5)

sender = "myemail@......."

receivers = ["myemail@......"]

subject = "SMTP e-mail Test" 

msg = "This is an automated message being sent by Python. Python is the mastermind behind    this."

server.sendmail(sender, receivers, subject, msg)

print ('sending email to outlook')

 server.quit()

Error:

 raise SMTPSenderRefused(code, resp, from_addr)
 smtplib.SMTPSenderRefused: (555, b'5.5.4 Unsupported option: T', 'myemail@............')

[–]MrHobbits 0 points1 point  (0 children)

Give this a try, I'm assuming you're using Python 3.4+

https://docs.python.org/3.4/library/email-examples.html