Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

AIX mail with attachment 2

Status
Not open for further replies.

cneirao

Programmer
Nov 5, 2002
5
0
0
CA
Hello everybody:

We are sending e-mails with files in attachment using "mail" and "uuencode" from a KornShell Script under
a AIX server.
Some of the persons who receive the e-mail are using NOTES
under WinNT are not able to open the e-mail at all.
But those using Notes under AIX there had no problem at all.

Any one of you have an idea, what could, be problem?

Thank a lot

Carlos Neira
 
/usr/bin/uuencode /home/root/test.txt /home/root/test.rtf > codefile
mail -s &quot;Systeminfo&quot; test@test.com < codefile
 
That's exactly the way we are sending the mail.

Thank you anyway.
 
I had the same problem. By using this script it works well.
Save this script in /usr/bin as snd_mail

#!/bin/ksh
: '
sendattch.sh : Encapsulate standard input as a MIME attachment
and mail it to the correct destination.

ARGS: 1: Delivery address
2: File to send as attachment
'
ADDR=$1
FILE=$2
INTCHG=`basename $2 .txt`
INTCHG1=$3

USAGE=&quot;Usage: sendattch.sh delivery_address file_name&quot;

TEMP=/tmp/$INTCHG.att

# Tidy-up Function

function doExit {
rm -f $TEMP
exit $1
}

# Validate arguments

[[ $# -eq 3 ]] || {
echo &quot;Invalid number of arguments: $#\n$USAGE&quot; >&2
doExit -1
}

# Construct the message

{
echo &quot;To: $ADDR&quot;
echo &quot;Subject: $INTCHG1&quot;
echo &quot;X-Priority: 3&quot;
echo &quot;MIME-Version: 1.0&quot;
echo &quot;Content-Type: application/msword;&quot;
echo &quot; name=\&quot;$INTCHG.txt\&quot;&quot;
echo &quot;Content-Disposition: attachment;&quot;
echo &quot; filename=\&quot;$INTCHG.txt\&quot;&quot;
echo &quot;Content-Description: $INTCHG&quot;
echo
cat $FILE
} > $TEMP

# Send the constructed message

/usr/sbin/sendmail $ADDR < $TEMP
doExit $?

Use the following command to send your mail.
snd_mail xxxxx@xxxx.xxx.xxx filetosend &quot;subject&quot;

regards
charles
 
Have a look under the General Unix Discussion FAQ, I have posted 2 sample scripts there. The one supporting multiple attachments works very well with some customisation to suit your specific needs. IBM Certified Confused - MQSeries
IBM Certified Flabbergasted - AIX 5 pSeries System Administration
 
Thanks a lot you guys.

The problem seems to be the command &quot;mail&quot;, when &quot;sendmail&quot; is used plus the MIME format everything is OK.

Now, I have to convince de people here to use the &quot;sendmail&quot;

Regards
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top