Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I am in the last step of the send mail config, due to some issues the send mail in /usr/sbin/ is not getting accessed even though i gave permissions. I have to perform the following step

     /usr/sbin/sendmail [email protected] < "My test email being sent from sendmail"
share|improve this question

1 Answer 1

sendmail expects email headers before email body on its standard input.

Try the test command below:

#!/bin/sh
/usr/sbin/sendmail -i -- [email protected] <<END
subject: test

My test email being sent from sendmail
END

-i - do not treat "single dot" line as end of message
-- - end of command line options (only recipient addresses follow)
-t - get recipient addresses from email headers

share|improve this answer
    
It is showing this type of error, bash: cd: /usr/sbin/sendmail: Not a directory –  user2164254 Mar 26 '13 at 11:16

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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