been searching for few hours, and came to no solution.

Is there an equal expression for the bash command

myfile | sendmail -t

where my information needed for sending mails is stored in the "myfile" ?

migrated from stackoverflow.com Nov 21 '12 at 13:58

This question came from our site for professional and enthusiast programmers.

  • Is myfile an executable, or do you mean to do <myfile sendmail -t? – William Pursell Nov 21 '12 at 9:03
  • myfile is a textfile containing information as : 'From: me@myserver.org' and 'Subject: MySubject' – Yunalescar Nov 21 '12 at 9:10

You don't specify your OS: On my Ubuntu system, /usr/bin/mail is redirected to /usr/bin/heirloom-mailx which has a -t option

  -t     The message to be sent is expected to contain a  message  header
         with  `To:',  `Cc:',  or  `Bcc:'  fields  giving its recipients.
         Recipients specified on the command line are ignored.


  • i have a Debian Squeeze running the simple mailutil as far as i know. – Yunalescar Nov 21 '12 at 12:01

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.