ref:
Mail 伺服器是什麼?如何運用? - StockFeel 股感
A Note About the Next Lesson: Google SMTP Port
In the next lesson, I'll show you how to send email using the smtplib
module and Python. If you are getting the error Connection unexpectedly closed, it might be due to a number of things. You can come back to this lesson to debug.
Gmail: smtp.gmail.com
Hotmail: smtp.live.com
Outlook: outlook.office365.com
Yahoo: smtp.mail.yahoo.com
If you use another email provider, just Google for your email provider e.g. "Gmail SMTP address"
Below are steps specific to users sending email from Gmail addresses.