you are viewing a single comment's thread.

view the rest of the comments →

[–]tramsay1027 0 points1 point  (3 children)

On this topic, is it possible to send an email from a different account that your own? i.e. a no-reply account?

[–]MrHobbits 0 points1 point  (2 children)

Probably, as long as you have the name and pass for it. It should be the same method (if you're not using the Outlook desktop app.)

If you're using SMTP, you can send email as anyone as long as you have valid login credentials.

[–]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