Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Python: Open Thunderbird to write new mail with attached file

I would like to open Thunderbird on Debian AND Windows with an attached file for a new email.

So I would like to do the same as in this thread but the posted solution does not work:

Python open email client with attachment

I have the very same problem as user2686223. The file will not be attached to the mail. Can anyone help me with this?

Maybe with another solution?

EDIT: This is now how it works:

import os
os.system("thunderbird -compose to='[email protected]',subject='subject',body='body',attachment='/path/to/file'")
like image 331
Ohumeronen Avatar asked Mar 18 '23 13:03

Ohumeronen


1 Answers

Start Thunderbird with the command line argument "-compose". More about it at http://kb.mozillazine.org/Command_line_arguments_%28Thunderbird%29

like image 90
user228011 Avatar answered Apr 02 '23 06:04

user228011