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 myemail@domain.com < "My test email being sent from sendmail"
share|improve this question
add comment

1 Answer

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

Try the test command below:

#!/bin/sh
/usr/sbin/sendmail -i -- myemail@domain.com <<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
add comment

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.