If you want to send an E-Mail quickly per Mozilla Thunderbird in Nautilus like the Send To Feature you have to write a little script. (I found a .deb for replacing Evolution with Thunderbird, but it did not work. Instead it killed the whole feature. At the end you will get a menu like the one in the screenshot on the right.
- Because I do not need Evolution in Nautilus I removed the nautilus-sento app. To do this execute the following:
sudo apt-get remove nautilus-sendto. - Create a file in ~/.gnome2/nautilus-scripts named sendto.
- Make it executable with chmod a+x sendto
- Paste the following one-liner into the file and save it
thunderbird -compose attachment="file://$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS"
Note: If you have Thunderbird 1.5 (or minor?) you must replace “thunderbird” with “mozilla-thunderbird”. - Restart Nautilus with
killall nautilus
Now you can right click on a file and select Scripts -> sendto to send a file as an attachment in Thunderbird.
For more scripts you can goto Nautilus File Manager Scripts.
Advertisements

Thanks, works great. Only problem was getting the full one line text string … it got truncated when I tried to copy it a couple of times … I’m viewing with thunderbird on ubuntu linux which might be the problem, might be better to include it as regular text rather than the html or whaterver it is?
Thanks again.
J
@Jim
I don’t know how to get it in one line. I only used the code-tag to highlight it.
I am getting and error message when trying to send an attachment this way.
Message reads:
Sending of message failed.
Unable to open the temporary file /home/myname/data/filename.txt
Check your ‘Temporary Directory’ setting.
The file shows up in the attachments box of the compose dialog and the path to the file is correct.
Re-attaching the file using the GUI provisions allows it to work.
Got a clue?
Alex
@Alex Seems to be a thunderbird-problem…
For Windows this trick seems to work:
Maybe it works for you if you empty /tmp and ~/.Trash ?
ataub2qf,
I did not know that Nautilus ran on Windows?
When was that release made? 😮
Can’t empty /tmp while the system is running.
I’m having the same issue with the attachments (using Linux).
Empty /tmp is not an option.
Any idea?
I am having this same temp file problem. Is there a solution for this? This thread just seems to stop.
Hmm on Feisty it works with nautilus-sendto:
Just click on the file you want to send with the right mouse button and select >Send to<, then choose Thunderbird as “Send as”
To solve the temporary directory problem, simply get rid of the quotation mark.
i.e. thunderbird -compose attachment=file://$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
It works for me 🙂
When I used apt-get to remove nautilus-sendto, it also removed ubuntu-desktop. When I reinstalled ubunut-desktop, it reinstall nautilus-sendto. I am in a continous loop.
Also, what if I want to use Gmail instead of Thunderbird.
Can I use the following line in the sendto script :
firefox https://mail.google.com/mail?view=cm&tf=0&to=`echo $1 | sed ‘s/mailto://’`
@Phil:
Maybe you can set firefox as your preferred E-Mail application and set firefox to use gmail as default.
Just wanted to say Thank You for the script. I was doing some work on my free time and decided to install Thunderbird and was just thinking how nice it would be to have a “Sendto” option…
Nice to see people willing to share there scripts.
Doug!
Thanks, nice script. But, how to send more than 1 file in 1 email?
Yeah, a second on sending more than one file (highlighted multiple).
Thanks though.
I did this w/ “nautilus actions” …
and created a send to thunderbird context menu item with the parameter
-compose attachment=file://%M
it works so far, I had tried it without success but then realized that I had to include the “file://” before the %M
You can use this application I’ve made to have full features sending nautilus selection as email :
http://sourceforge.net/projects/mailpictures
or you can do this:
http://ubuntuforums.org/showpost.php?p=9251482&postcount=23
another one.
Change the onliner with the more advanced script that handle several files
#!/bin/bash
set -x
#thunderbird -compose attachment=file://$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS
# attach multiple files thunderbird.sh
#thunderbird -compose “attachment=’file:////home/will/newfile,file:////home/will/newfile2′”
#-compose subject=Emailing %m,attachment=%u
if [ $NAUTILUS_SCRIPT_SELECTED_FILE_PATHS = “” ] ;then echo “no files given” ; exit 1 ;fi &>/dev/null
Y=`echo file://$NAUTILUS_SCRIPT_SELECTED_FILE_PATHS | sed ‘s/ \//,file:\/\/\//g’ | sed ‘s/ /^^/g’` #this sed replaces all spaces with a ^^.
X=`echo $Y | sed ‘s/\^^/ /g’` #this sed replaces all ^^’s with a space
Z=`echo $Y | sed ‘s/,file:\/\// /g’`
ii=1 #that sed (below)replaces all ^^’s with a space
BODY=$(for file in $Z ;do C=`basename “$(echo $file | sed ‘s/\^^/ /g’)”` ; echo ; echo -n “$ii) $C” ; ii=$(($ii+1)) ; done)
thunderbird -compose “attachment=’$X'”,body=”P.S. – Attached Files: $BODY”,subject=”attached files”
multiple attachment doenst work for me…
single attachment does work, but when i select multiple files the contextmenu doesn’t show the option anymore. UBUNTU 10.10 here
I’ve created an Ubuntu bug for this problem. Please confirm or add additional comments over at https://bugs.launchpad.net/ubuntu/+source/nautilus-sendto/+bug/757976
Does anybody have any idea as to when/if the thunderbird email send to option will be implemented?
Excellent, really happy with this cheers 🙂