Attach files from Dolphin to thunderbird

Tags: #<Tag:0x00007fe3198a18e0> #<Tag:0x00007fe3198a1610> #<Tag:0x00007fe3198a1250>

Hello.
I am always been wondering how attach a file to Thunderbird directly from Dolphin. I installed the service by the configuring tool within Dolphin, but doesn’t work.
Any suggestion ?

Why attach a file directly to Thunderbird? I only know of attaching a file to an e-mail I’m writing/sending. There you simply go to the ‘Composition toolbar’ and select ‘Attach’ and select files and locate the file and select ‘Open’ and it automatically attaches unless the file is to big to handle.

If you don’t see a ‘Composition toolbar’ open ‘Write’ look in the Menu bar for ‘View’ and then ‘Toolbars’.

Edit: And if you do have a file to big to handle T-bird will open a dialog window and offer some suggestion or other. Or you can compress the file yourself with any of the available compression algorithms. LIke gz, bz2, xz, or lzma, and probably more choices.

Well…it was just to save a little time, as normally done in standard file managers. But, OK, Thunderbird can manage attached files, easily…

You may try something like this.

or you can try in this way:
in ~/.local/share/kservices5/ServiceMenus/

put a .desktop file like this:

[Desktop Entry]
Type=Service
Actions=SendToMailRcp
Encoding=UTF-8
MimeType=application/octet-stream
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
X-KDE-Priority=TopLevel
#X-KDE-Submenu=Send To

[Desktop Action SendToMailRcp]
Name=Invia tramite Thunderbird..
Exec=thunderbird -compose attachment="file:///%f"
Icon=thunderbird
2 Likes

Maybe there is something I don’t understand. Where would I put files in an e-mail client rather than in an e-mail itself? How do you do this in standard file managers?

You blithering dumb@#$. You would put it in Thunderbird>Tools>Saved files. But how do I do that from Dolphin? Don’t know yet. You can right click on a file in Dolphin and select to open it with Thunderbird and it will open the “Write” window to write an e-mail with that file already attached. Otherwise I need to find the actual path for Thunderbird>Tools>Saved files to move files from Dolphin to there.

Exec=thunderbird -compose attachment=“file:///%f”

OK, I’m a little slower than you but I finally get it. This does work. Specifically I created a file called (you want to do as user not root):

~/.local/share/kservices5/ServiceMenus/sendto.desktop

I did change the line:

Name=Invia tramite Thunderbird..

to:

Name=Attach to Thunderbird..

but this does work. And once again you have forced me to learn something:smiling_imp:

Here shows Dolphin in a directory I call Data1 where I right click on any file and you see the result:

So thanks to @luca . And thanks to @alangea for bringing the issue up.

That links to an app called thunderbird_attachment. FWIW that file will probably also work if you use the same path Luca was so kind as to point us to.

Edit: In other words you could download and unzip that file and as user copy and paste the contents of the unzipped file to:

~/.local/share/kservices5/ServiceMenus/thunderbird_attachment.desktop

Edit: With this file you have to right click on the file then go to ‘Actions’ to get to the ‘Attach to Thunderbird’.

Thanks to @mandian.

1 Like

there is no need.

luca@luca:~/.local/share/kservices5/ServiceMenus$ ls -al
totale 20
drwxr-xr-x 2 luca luca 4096 mar 11 21:58 .
drwxr-xr-x 3 luca luca 4096 feb 10 15:18 ..
-rw-r--r-- 1 luca luca 6459 mar 10 18:05 konsolehere.desktop
-rw-r--r-- 1 luca luca  321 mar 11 21:58 sendto.desktop

or take a look at /usr/share/kservices5/ServiceMenus

Ok. That’s fine.
Could You tell me where yo get the file You mentioned. Sorry, I didn’y catch it…

I mean, is that file already where You said ?
I’m not at my home desktop, at moment I am at work and cannot check.

You copy and paste from @luca’s post above.

No, you need to create it. You probably will also be creating the directories:

~/.local/share/kservices5
and
~/.local/share/kservices5/ServiceMenus

and the file sendto.desktop is created in:

~/.local/share/kservices5/ServiceMenus

I did it all. Still doesn’t appear in the menu…

Assuming you used ‘sendto.desktop’ for the file name what is out put of:

$ ls -l ~/.local/share/kservices5/ServiceMenus/sendto.desktop

if you used a different name just change that in the command string.

[alangea@localhost share]$ ls -l ~/.local/share/kservices5/ServiceMenus/sendto.desktop
-rwxrwxr-x 1 alangea alangea 318 mar 12 19:44 /home/alangea/.local/share/kservices5/ServiceMenus/sendto.desktop

That should work if you used the script @luca provided:

[Desktop Entry]
Type=Service
Actions=SendToMailRcp
Encoding=UTF-8
MimeType=application/octet-stream
X-KDE-ServiceTypes=KonqPopupMenu/Plugin
X-KDE-Priority=TopLevel
#X-KDE-Submenu=Send To

[Desktop Action SendToMailRcp]
Name=Attach to Thunderbird..
Exec=thunderbird -compose attachment="file:///%f"
Icon=thunderbird

the above is an exact copy and paste of mine. I’ve used this on multiple computer now.