3

Been looking through some of the examples and I am obviously doing something wrong as none of them are working for me. I can send a simple email with text, but when I try to send an attachment it says "file not found". I am running these statements from the folder that the file exists in:

echo -e "This is the body" | mutt -a /home/adrian/Backups/Server1/MyFile-2013-04-17.zip myEmail@gmail.com -s "This is the subject"

echo -e "This is the body" | mutt -a MyFile-2013-04-17.zip myEmail@gmail.com -s "This is the subject"

Is there any sort of pre-requisite for the types of files that can be sent, or a path syntax?

Adrian
  • 670
  • 10
  • 24

1 Answers1

4

Try this..

echo -e "This is the body" | mutt -a "/home/adrian/Backups/Server1/MyFile-2013-04-17.zip" -s "This is the subject" -- myEmail@gmail.com 
vidit
  • 6,293
  • 3
  • 32
  • 50
  • You legend! Is there a file size limit? When I send a file thats 684KB then it works, but if I send one thats 60MB then it fails. – Adrian Apr 18 '13 at 21:03
  • 1
    @Adrian- As far as I know the size limit is not controlled by mutt, but by exim4 which is the MTA. It might also be limited by your SMTP server. – vidit Apr 18 '13 at 21:11
  • Two points looks important: 1. -a (for attachment) use with absolute file path, 2. before destination email address should ahead with double hyphen --, in my test it won't find email address if not with -- – Lampard Aug 12 '20 at 18:43