通过 python 脚本发送电子邮件是否安全
Is it safe to send email through a python script
我有一个 .py 和一个 .sh 文件。
.sh 包含发送电子邮件的功能。
而 .py 只是执行它。
现在我的问题是,以这种方式发送电子邮件安全吗?
它与通过 gmail.com 发送的安全性相同吗?
感谢
您可以使用 yagmail(完全披露:我是开发人员)直接从命令行发送,或从 python.
内发送
pip install yagmail # for python 2
pip3 install yagmail # for python 3
# Command line:
yagmail -u me@gmail.com -p password -t target@email.com -c "Hello there!"
或者您可以发送 python(使用一些魔法):
import yagmail
yag = yagmail.SMTP()
yag.send(contents = ["See this attachment", "/local/path/to/song.mp3"])
有很多技巧,因此您无需在脚本或命令行中使用密钥环再次键入密码(甚至用户名)。
看看yagmail的文档,感觉真的可以省去很多麻烦
我有一个 .py 和一个 .sh 文件。 .sh 包含发送电子邮件的功能。 而 .py 只是执行它。
现在我的问题是,以这种方式发送电子邮件安全吗? 它与通过 gmail.com 发送的安全性相同吗? 感谢
您可以使用 yagmail(完全披露:我是开发人员)直接从命令行发送,或从 python.
内发送pip install yagmail # for python 2
pip3 install yagmail # for python 3
# Command line:
yagmail -u me@gmail.com -p password -t target@email.com -c "Hello there!"
或者您可以发送 python(使用一些魔法):
import yagmail
yag = yagmail.SMTP()
yag.send(contents = ["See this attachment", "/local/path/to/song.mp3"])
有很多技巧,因此您无需在脚本或命令行中使用密钥环再次键入密码(甚至用户名)。
看看yagmail的文档,感觉真的可以省去很多麻烦