Results 1 to 5 of 5
Hi ,
I am trying to send a mail which has no body but only subject line using the mutt and mail commands but command does not execute properly.
mutt ...
- 12-04-2007 #1Just Joined!
- Join Date
- Nov 2007
- Posts
- 8
Sending mail without message body
Hi ,
I am trying to send a mail which has no body but only subject line using the mutt and mail commands but command does not execute properly.
mutt -s "test mail" glopes@clemson.edu
I am able to send a mail with a body by using
mutt -s "test mail" glopes@clemson.edu < body.txt
Kindly help me
- 12-04-2007 #2Linux User
- Join Date
- Jun 2007
- Posts
- 318
Try this:
Code:mutt -s "test mail" glopes@clemson.edu << EOT EOT
- 12-04-2007 #3Just Joined!
- Join Date
- Nov 2007
- Posts
- 8
hey vsemaska ,
thank you for your reply.
The command works fine when executed at command line but I am using the mutt command in a script and the script gives me the followin error now
./try_prj2.sh: syntax error at line 40: `end of file' unexpected
The code is given below
#!/bin/sh
## The entries of syslog are stored in storelogs
storelogs=/var/log/syslog
badUser=student
## temp file
temporary=/tmp/temp1
echo $badUser
#Taking the entry student and sending it to the temp file
grep $badUser dumpFile.txt > /dev/null
##echo "before 1st if"
if [ $? -eq 0 ];then
echo $badUser > /tmp/temp1
grep -s $badUser /var/preserve/glopes/glopes.txt > /dev/null
if [ $? -eq 0 ];then
echo "No mail"
exit 2
fi
## if the name does not exist then send a mail and add the name to a file
mutt -s "test mail" glopes@clemson.edu << EOT EOT
grep $badUser $temporary > /var/preserve/glopes.txt
# deleting thee temporay files generated
rm $temporary
fi
- 12-04-2007 #4Linux User
- Join Date
- Jun 2007
- Posts
- 318
This:
should be this:Code:mutt -s "test mail" glopes@clemson.edu << EOT EOT
The 2nd EOT has to be on a line of its own. The '<< EOT' means input are the lines that follow until 'EOT' is reached.Code:mutt -s "test mail" glopes@clemson.edu << EOT EOT
- 12-04-2007 #5Just Joined!
- Join Date
- Nov 2007
- Posts
- 8
Thank you vsemaska!
It worked!


Reply With Quote