| Subject parameter in sendmail [message #98260] | 
			Wed, 02 June 2004 12:28   | 
		 
		
			
				
				
				
					
						
						bheemsen aitha
						 Messages: 4 Registered: June 2004 
						
					 | 
					Junior Member  | 
					 | 
		 
		 
	 | 
 
	
		Hi, 
 
We are using the sendmail utility on our AIX box to send emails to our clients in our network. During the last one month it is NOT working properly. The problem is that the subject line coming as blank in the email. 
 
We are using the following syntax for the past one year. 
 
smartmail.sh <alias> <file to attach> <subject> | sendmail -t 
 
The program smartmail.sh is below: 
 
  
 
function formatheader 
{ 
mailids=$(echo $mailid | sed 's/ /,/g') 
print "to: $mailids 
sub: $sub 
content-type: text/html 
 
" > $tmp 
} 
 
function formatbody 
{ 
print "<html> 
<body> 
" >> $tmp
cat $fil >> $tmp
print "  
</body> 
</html> 
 
" >> $tmp 
} 
 
function exitWithSplash 
{ 
        print "usage : smartmail <alias> <file> <subject> " 
        exit 1 
} 
 
#### 
# main sir 
##### 
 
if [[[[ $# -lt 3 ]]]] 
then 
        exitWithSplash 
fi 
 
usr=$1 
fil=$2 
sub=$3 
tmp=/tmp/smartmail.$$ 
maildb=$HOME/.mailrc 
rm -f $tmp 
 
data=$(cat $maildb  | grep "^alias $usr ") 
if [[[[ $? -ne 0 ]]]] 
then 
        print "Sorry no records found with alias $usr in $maildb" 
        exit 1 
fi 
 
if [[[[ ! -f $fil ]]]] 
then 
        print "Sorry file $fil could not be opened .. exit status $?" 
        exit 1 
fi 
echo $data |  while read a b mailid 
do 
        formatheader 
        formatbody 
 
done 
 
cat $tmp 
 
  
 
  
 
  
 
Can someone please help on what's wrong with our sendmail utility. 
 
Thanx.. 
 
PS: The program smartmail.sh is working fine. 
 
-Bheemsen 
 
  
 
  
 
  
 
  
 
 
		
		
		
 |  
	| 
		
	 | 
 
 
 | 
	| 
		
 | 
	| 
		
 |