Python打开电子邮件客户端附件 [英] Python open email client with attachment

查看:270
本文介绍了Python打开电子邮件客户端附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试打开电子邮件客户端(例如,雷鸟)发送带有附件的电子邮件。我试图用 webbrowser.open('mailto:[...]?attachment =path_to_file')打开客户端,但没有附件。我也试图写入 file:// path_to_file
我在网上搜索了一个解决方案,但是我只找到了如何使用SMTP发送电子邮件的教程。你有个想法吗?

I'm trying to open a email-client (eg thunderbird) to send an email with an attachment. I have tried to open the client with webbrowser.open('mailto:[...]?attachment="path_to_file"'), but there was no attachment. I also tried to write file://path_to_file. I have searched in the web for a solution, but there I only found tutorials how to send emails with SMTP. Do you have an idea?

推荐答案

我会使用这个 python配方,便于携带和可靠的方式在python中发送带有附件的邮件。

I would use this python recipe for a portable and sound way to send mails with attachments in python.

这篇关于Python打开电子邮件客户端附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆