Python open email client with attachment
Asked Answered
M

2

3

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?

Microfilm answered 23/8, 2014 at 9:49 Comment(0)
K
1

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

Kornher answered 23/8, 2014 at 9:56 Comment(1)
Thanks for your fast answer. With python t.py -m [email protected] --attach="file://home/aha/top.png" a client (thunderbird) is opening but without a file as attachment. mailto_string in line 286 is: mailto:[email protected]?attach=file%3A%2F%2Fhome%2Faha%2Ftop.png what am I doing wrong?Microfilm
T
0

You can achieve the same result by calling thunderbird via system commands.

Here is a thread that I started. I got a good reply:

Python: Open Thunderbird to write new mail with attached file

Triangulate answered 7/9, 2014 at 12:34 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.