Syntax issue sending email via mutt on EC2

I am trying to send an email from my Amazon EC2 node using mutt, and I get an error message which I assume is the syntax, but I cannot see what I am doing wrong. I am trying to send an email with txt attachment

echo "Sending Test" | mutt -a test.txt -s "test email" name@emaildomain.com 

However, I get the following errors:

 Can't stat name@emaildomain.com : No such file or directory name@emaildomain.com : unable to attach file 

Obviously, we are trying to attach a file, which is the name of the email, but I do not understand why. Any help would be greatly appreciated.

+4
source share
1 answer

In recent versions of mutt, the -a option is for resolving multiple arguments, so you can make -a *.txt to attach any number of files matching this pattern. Because of this, it should be the last option used and separated from the recipients -- :

 echo Sending Test | mutt -s "test email" -a test.txt -- name@example.com 
+6
source

Source: https://habr.com/ru/post/1494506/


All Articles