1

I want to send a mail with attachment from linux command line using sendmail utility.

Here's the command, I am running from terminal on linux machine.

sendmail -f ru@gmail.com -t sm67@gmail.com -m "testing the attachement using sendmail unix" -a AnnualReport.docx

But this command is not sending mail. Can someone share the appropriate command. I have to use sendmail utility only.

Reena Upadhyay
  • 1,977
  • 20
  • 35
  • are you able to use sendmail to send a test email without attachments? If not, chances are- sendmail is not configured correctly. You may want to refer to this blogpost about configuring sendmail to work from "localhost": https://www.jeffgeerling.com/blogs/jeff-geerling/configure-sendmail-centos Otherwise, refer to the CentOS Sendmail documentation at: https://www.centos.org/docs/5/html/5.1/Deployment_Guide/s3-email-mta-sendmail-default.html – Anson W Han Dec 07 '17 at 04:58
  • sendmail is configured properly, Pragmatically I am able to send mail using sendmail. But through terminal, i am facing problem. May be some syntax issue. – Reena Upadhyay Dec 07 '17 at 05:43
  • `-m` and `-a` are not supported by canonical sendmail (sendmail by sendmail.org). Name "sendmail look alike" you use. – AnFi Dec 07 '17 at 07:57
  • @AnFi Can you please share the correct command? – Reena Upadhyay Dec 07 '17 at 16:05
  • Search a little for many solutions/recipe provided at the site e.g. https://stackoverflow.com/questions/17359/how-do-i-send-a-file-as-an-email-attachment-using-linux-command-line – AnFi Dec 07 '17 at 18:31
  • @AnFi In the link which you have shared, mutt command is used. I have already specified in my question that I want send mail using sendmail utility only. – Reena Upadhyay Dec 10 '17 at 15:24

0 Answers0