LinuxQuestions.org

LinuxQuestions.org (/questions/)
-   Programming (https://www.linuxquestions.org/questions/programming-9/)
-   -   how to execute mail command in a shellscript (https://www.linuxquestions.org/questions/programming-9/how-to-execute-mail-command-in-a-shellscript-110265/)

mema 10-30-2003 02:38 AM

how to execute mail command in a shellscript
 
pls tell me how to excute mail command in shell script

i had given mail -s "hello raj" raj in shell,
where raj is username
but when i execute that script cursor is wainting for input until i press cntrl+d

But i have to send mail to a user in a shellscript not from the prompt

SaTaN 10-30-2003 02:58 AM

Have the body of the letter in a file
Code:

cat body.txt | mail -s "Hello raj" raj
will send a mail with body.txt as body of the letter and
subject as Hello raj


All times are GMT -5. The time now is 01:14 PM.