1

I am using the mail command from mailutils on Ubuntu Linux 20.04. I am using it to send documents automatically to a service on the web which processes them. They provide an email address to which you can forward your document as an attachment.

When I use my normal email client, say, thunderbird, or SOGO mail, and manually send a document it works fine, and the document is received as expected and processed. However, when I use the mail command like this:

echo "The body of the email" | mail -s "just a test" [email protected] -A my_attachment.pdf 

the remote service acts as though it has received two documents, the actual attachment, and also the body of the email as another attachment. This makes me think the mail command somehow sends the body as an attachment or something in a different way to other email programs I use. The emails from mail look fine in my own email client.

So how do I get my emails from mail to look like they only have one attachment, just like my manual emails? If not possible is there an alternative command line email program on Ubuntu which will act in the way I want?

1 Answer 1

0

After some experimentation I found that mutt seems to work the way I want. If I do

echo "" | mutt -s "Email Subject" [email protected] -a attachment.pdf 

It appears as a single attachment in the other service

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.