Unknown Attachment received on html mail


 
Thread Tools Search this Thread
Top Forums UNIX for Advanced & Expert Users Unknown Attachment received on html mail
# 1  
Old 09-16-2009
Unknown Attachment received on html mail

Hello,

Getting an extra attachment when i send a mail using below code.
The body and the rest of the attachments look very fine.
The extra attachment to be exact has a name ATT00001.txt. Smilie
This is not part of my $attach_list.

Code:
BOUNDARY='------The Boundary-----'
print - "From: $MAILFROM" > $TMP/tmp/out.mail
print - "To: ${MAILTO}>" >> $TMP/tmp/out.mail
print - 'Subject:' $SUBJECT >> $TMP/tmp/out.mail
print - 'MIME-Version: 1.0' >> $TMP/tmp/out.mail
print - 'Content-Type: MULTIPART/MIXED; ' >> $TMP/tmp/out.mail
print - '    BOUNDARY='\"$BOUNDARY\" >> $TMP/tmp/out.mail
print - "--${BOUNDARY}" >> $TMP/tmp/out.mail
print - 'Content-Type: text/html; charset=US-ASCII' >> $TMP/tmp/out.mail
print - >> $TMP/tmp/out.mail
cat $REP_FILE >> $TMP/tmp/out.mail
cat $TMP/tmp/Table.html >> $TMP/tmp/out.mail
print - >> $TMP/tmp/out.mail
while read file
do
echo $file
echo "\n" >> $TMP/tmp/out.mail
echo  "--${BOUNDARY}" >> $TMP/tmp/out.mail
echo  'Content-Type: text/html; charset=US-ASCII; name='$file >> $TMP/tmp/out.mail
echo  'Content-Disposition: attachment;   filename='$file >> $TMP/tmp/out.mail
echo "\n" >> $TMP/tmp/out.mail
cat $TMP/tmp/$file >> $TMP/tmp/out.mail
echo "\n" >> $TMP/tmp/out.mail
done < $ATTACH_LIST
echo "--${BOUNDARY}" >> $TMP/tmp/out.mail

/usr/lib/sendmail ${MAILTO} < $TMP/tmp/out.mail

This is on Solaris - ksh.

Regards,
pgop

---------- Post updated at 08:09 PM ---------- Previous update was at 07:53 PM ----------

Removed the Last boundary and the attachment is off! Smilie Smilie
# 2  
Old 09-24-2009
Java Attachment

Ooops ... ignore my comment ... I mis-read it ...


below is code to send a attachment from shell ...
Code:
uuencode file.jpg file.jpg | mail -s "File.jpg as attachment" chakrapani@whatever

Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

HTML mail with Attachment

Hi, I am using the below code: #!/bin/ksh SUBJ="Send mail from Unix with file attachments" TO=sudha.viswanathan@jpmorgan.com CC=sudha.viswanathan@jpmorgan.com ( cat << ! To : ${TO} Subject : ${SUBJ} Cc : ${CC} ! cat << ! MIME-Version: 1.0 Content-Type: text/html `cat... (1 Reply)
Discussion started by: sudvishw
1 Replies

2. Shell Programming and Scripting

Need help in sending html mail with attachment

Hi Everyone, I am facing problems in sending html mail with attachemnt. I will able to send mail with attachment (plain text ) using mailx -s and uuencode command and also html mail without attachment using sendmail option. However I am not able to send html mail along with attachment.Either... (2 Replies)
Discussion started by: karthik adiga
2 Replies

3. Shell Programming and Scripting

[SOLVED] Read html attachment from /var/mail

Hi, I am receiving an email to the server with a html attachment. When I check the /var/mail the attachment is showing as junk characters. I want to move that html file to a particular location in that server. Please help me. Regards Neethu (4 Replies)
Discussion started by: Neethu
4 Replies

4. Shell Programming and Scripting

MIME - HTML mail with Excel attachment - Please help!

#!/bin/ksh ( echo "MIME-Version: 1.0" echo "Content-Type: multipart/mixed; boundary=frontier" echo "--frontier" echo "Content-Type: text/html" echo "Content-Disposition: inline" echo "\n" echo "<html><body><h1>this is html formatted text</h1></body></html>" echo "--frontier" echo... (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

5. Shell Programming and Scripting

Unable to send mail with inline html along with attachment. Please help!

The below code is not working. I am able to send only inline html or only attachment. When trying to do both, only inline html is sent without attachment. Please help! #!/bin/ksh (echo "Subject: Test Mail - HTML Format" echo "MIME-Version: 1.0" echo "Content-Type: text/html" echo... (1 Reply)
Discussion started by: thulasidharan2k
1 Replies

6. UNIX for Dummies Questions & Answers

How to send html file in a mail not as an attachment but it should display in the mail in table for

Hi The below script working when we are sending the html as attachment can u please guide how to send thesmae data in table form direct in the mail and not in mail attachment . cat Employee.sql SET VERIFY OFF SET PAGESIZE 200 SET MARKUP HTML ON SPOOL ON PREFORMAT OFF ENTMAP ON - HEAD... (0 Replies)
Discussion started by: mani_isha
0 Replies

7. Shell Programming and Scripting

Sending HTML attachment through mail

Hi I am new to unix and scripting.I am trying to send a html file as an attachment. SUBJECT="Type of Exceptions in Application" TO=Sushovan.Samals@gmail.com SPOOLFILE=/data/reg/tlogs/Monitor.html #echo "Send the E-mail message..." uuencode $SPOOLFILE $SPOOLFILE | mailx -s "$SUBJECT" $TO... (2 Replies)
Discussion started by: sushovan
2 Replies

8. AIX

Command line/Script to send E-mail with HTML body and binary attachment

I apoligize for the cross-post but I'm not getting much in the way of help in the dummies forum: I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements: 1. command line switch to specify file name containing message body in HTML format 2. command... (3 Replies)
Discussion started by: G-Man
3 Replies

9. UNIX for Dummies Questions & Answers

AIX send mail with HTML message body and a binary attachment

I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements: 1. command line switch to specify file name containing message body in HTML format 2. command line switch to specify file name of a binary attachment 3. command line or input file to specify... (4 Replies)
Discussion started by: G-Man
4 Replies

10. Shell Programming and Scripting

Send an attachment and html text both in the same mail

Hi all, I am working on UNIX (Solaris28). I would like to send an email in which the body will be in html format and, in the same mail, a xls file has to be attached. I have tried this: the file is correctly attached but the body comes as html source and not formatted. If I do not attach the... (4 Replies)
Discussion started by: stefan.yu
4 Replies
Login or Register to Ask a Question