ส่งเมล์ด้วย Lib YaGmail on Python

The above Python code makes email sending easy. It can be a great start for creating some automation or notification systems. If you would like to have more functionality, you can code it yourself or use existing packages. I would recommend yagmail for advanced email sending (if you would like to send attachments, HTML version of the content). The usage of yagmail is simple

2022-10-26 17:33:11 - @ratanon

# after installation with
# pip install yagmail[all]

import yagmail
yag = yagmail.SMTP(EMAIL_ADDRESS, EMAIL_PASSWORD)
yag.send("to@someone.com", "subject", "message")

https://yagmail.readthedocs.io/en/latest/setup.html

More Posts