Why no attachment seen???


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers Why no attachment seen???
# 1  
Old 08-14-2006
Why no attachment seen???

Hi there

This is my piece of code :
Code:
#!/usr/bin/ksh
 set -x

FILE_NAME="test.xls"
(
echo "From:Amruta Pitkar"
echo "To:amrutapitkar@yahoo.com"
echo "Subject:Ebill Department Trial"
echo "Cc:uma_cancer@hotmail.com"
echo "MIME-Version: 1.0"
echo 'Content-Type:multipart/mixed; boundary="-"'
echo "-----"
echo "Content-Type:text/html"
echo "Content-Disposition:inline"
)>AHTMLFILE

(
echo "----"
echo "Content-Type:application/octet-stream;name=$FILE_NAME"
echo "Content-Transfer-Encoding:x-uuencode"
echo "Content-Disposition:inline;filename=$FILE_NAME"
echo "-----"
)>AXLSFILE

uuencode test.xls MyAttach > MyAttach
cat AHTMLFILE e28931.htm AXLSFILE MyAttach | sendmail apkar@yahoo.com
echo "Done mail sent"

When I view the sent email on yahoo account I can see the Attachment Symbol on the Subject line...but there is no attachment and Msg Body in the actual email whne opened....
Can somebody tell me why ????
Also the attachment can be any file type...eg .rtf, .pdf, .doc, .xls etc

PLEASE....
# 2  
Old 08-14-2006
Your MIME boundaries are incorrect.
Code:
#!/usr/bin/ksh

FILE_NAME="test.xls"
(
echo "From:Amruta Pitkar"
echo "To:to@emailaddr.com"
echo "Subject:Ebill Department Trial"
echo "Cc:cc@emailaddr.com"
echo "MIME-Version: 1.0"
echo 'Content-Type:multipart/mixed; boundary="A_MIME_BOUNDARY"'
echo "--A_MIME_BOUNDARY"
echo "Content-Type:text/html"
echo "Content-Disposition:inline"
)>AHTMLFILE

(
echo "--A_MIME_BOUNDARY"
echo "Content-Type:application/octet-stream;name=$FILE_NAME"
echo "Content-Transfer-Encoding:x-uuencode"
echo "Content-Disposition:inline;filename=$FILE_NAME"
echo "--A_MIME_BOUNDARY"
)>AXLSFILE

uuencode test.xls MyAttach > MyAttach
cat AHTMLFILE e28931.htm AXLSFILE MyAttach ### NOTE: You should also include a final MIME boundary here as well ###  | sendmail to@emailaddr.com
echo "Done mail sent"

# 3  
Old 04-27-2009
Quote:
Originally Posted by tmarikle
Your MIME boundaries are incorrect.
Code:
#!/usr/bin/ksh
 
FILE_NAME="test.xls"
(
echo "From:Amruta Pitkar"
echo "To:to@emailaddr.com"
echo "Subject:Ebill Department Trial"
echo "Cc:cc@emailaddr.com"
echo "MIME-Version: 1.0"
echo 'Content-Type:multipart/mixed; boundary="A_MIME_BOUNDARY"'
echo "--A_MIME_BOUNDARY"
echo "Content-Type:text/html"
echo "Content-Disposition:inline"
)>AHTMLFILE
 
(
echo "--A_MIME_BOUNDARY"
echo "Content-Type:application/octet-stream;name=$FILE_NAME"
echo "Content-Transfer-Encoding:x-uuencode"
echo "Content-Disposition:inline;filename=$FILE_NAME"
echo "--A_MIME_BOUNDARY"
)>AXLSFILE
 
uuencode test.xls MyAttach > MyAttach
cat AHTMLFILE e28931.htm AXLSFILE MyAttach ### NOTE: You should also include a final MIME boundary here as well ###  | sendmail to@emailaddr.com
echo "Done mail sent"


I have the similiar issues, can you please explain what is A_MIME_BOUNDARY?
 
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Sendmail with attachment

Hello people, I only have sendmail and uuencode on a Oracle (RH) linux server. While: /usr/bin/uuencode awr.html awr.html | /usr/sbin/sendmail myemail@company.com Is working fine, the ideal for me is to do something like: echo "To: me@company.com" > /home/vasilis/msg.txt echo "Subject: DB... (3 Replies)
Discussion started by: drbiloukos
3 Replies

2. Solaris

Sent an email attachment, but the attachment is empty

I'm trying to send a .zip file from my unix box to my work email (email client outlook) The file name that I'm trying to sent is sites.zip and this is how I do it: uuencode sites.zip | mailx -s "testing" myname@mydomain.com When I open the .zip, the zip is empty. Looking around the we, I... (17 Replies)
Discussion started by: amb1s1
17 Replies

3. Solaris

mailx with attachment

Hi, When i used below command, i am able to send mail mailx -s "Testing mail working or not " babu.sudhakar@ymail.com" but if i want send attachment with mail,which syntax i need to follow to send a file as attachment. (3 Replies)
Discussion started by: sridhardwh
3 Replies

4. Shell Programming and Scripting

Adding an attachment as an attachment to mailx

I don't want the attachment embedded in the mail. I would like a file attached. When I do mailx -s "Report, `date +'%D %r` " -r "Notifications" bob@bob.com < /usr/local/bin/myreport.log> /dev/null It gets embedded in my email. I want a file attachment. How do I do that? (2 Replies)
Discussion started by: guessingo
2 Replies

5. Shell Programming and Scripting

need help in format an attachment

i have an o/p file called "all_rep_files.txt" . Below is the command i m using in my script to send the attachement. but the problem is when the attachment is opened in oulook the contents of the attachments is in a staright line. (uuencode all_rep_files.txt all_rep_files.txt) | mail -s "All... (1 Reply)
Discussion started by: ali560045
1 Replies

6. AIX

Email with Attachment

Hi, I have .ksh file which internally calls a .sql file. This sql file writes a file with the result. I am using the following command to send email with the result file as attachment uuencode file.txt file.txt | mail -s "Subject" abc@abc.com. When i run the .ksh file i get a message you... (5 Replies)
Discussion started by: piyushprabhakar
5 Replies

7. Solaris

attachment using sendmail

Hi, I use the sendmail command to send automatic e-mail in my control programs, but I'd like to know if there's a non interactive way to send an attachment, like a small text file through sendmail command. I didn't find a way in the man, so anyone has already done it?.. give an example for the... (4 Replies)
Discussion started by: vastare
4 Replies

8. Windows & DOS: Issues & Discussions

Open an attachment...

Hey guys on windows XP i am trying to open an attachment but the program is saying it is unsafe. Is there anyway to bypass this message and open the attachment anyway? I know its nothing harmful but im guessing the computer thinks it is. Any advice will be extremely helpful. Thanks in advance,... (1 Reply)
Discussion started by: Corrail
1 Replies

9. UNIX for Dummies Questions & Answers

Mailing an attachment

Hi, I need to compress (zip) a flat file and mail the same as an attachment. I had tried the following piece of code. But when i open the attachment in mail, the data is incorrect (displays all junk characters). tar cf abc.tar abc.txt compress abc.tar uuencode abc.tar.Z abc1.wri | mailx... (4 Replies)
Discussion started by: gayath3
4 Replies

10. Shell Programming and Scripting

Mailing an attachment

Hi, I need to compress (zip) a flat file and mail the same as an attachment. I had tried the following piece of code. But when i open the attachment in mail, the data is incorrect (displays all junk characters). tar cf abc.tar abc.txt compress abc.tar uuencode abc.tar.Z abc1.wri | mailx -s... (0 Replies)
Discussion started by: gayath3
0 Replies
Login or Register to Ask a Question