An empty attachment coming with the name of subject


 
Thread Tools Search this Thread
Top Forums UNIX for Dummies Questions & Answers An empty attachment coming with the name of subject
# 1  
Old 07-16-2010
Bug An empty attachment coming with the name of subject

Hi All,
I am sending a mail with attachment only in this way.
But each time with attachment comes another attachment with the
name of "Testing.txt" which is just an empty text file how to remove this
thing please help

(uuencode ./file2.txt "Bad file")|mailx -s "Testing" maindola@rediff.com

also i want to send message along with attachment. I have tried all the solution already given in this blogs but they are not working so please
help me.

Thanks and Regards,
Amit Maindola
# 2  
Old 07-18-2010
Quote:
(uuencode ./file2.txt "Bad file")|mailx -s "Testing" maindola@rediff.com
Some points.
1) In this context we want the output from uuencode to be to a pipe, so we don't want the second parameter.
2) Assuming you will read the attachment in a Microsoft mail reader it is necessary to convert from unix to MSDOS format and ensure that the attachment has a ".txt" file extension. The exact commmand for conversion varies but is usually ux2dos or unix2dos.
3) We need the "-m" parameter to "mailx".
4) It always helps to know what Operating System you have because there is much variation in the "mailx" command expectially between true unix and the umpteen variations on unix-like Operating Systems such as Linux.

Code:
(ux2dos ./file2.txt | uuencode attachment.txt)|mailx -m -s "Testing" maindola@rediff.com


If we want the same file to appear in the mail body as well as an attachment.
Code:
(cat ./file2.txt ; ux2dos ./file2.txt | uuencode attachment.txt)|mailx -m -s "Testing" maindola@rediff.com

# 3  
Old 07-21-2010
Hi All,
The command is not working in my system it is showing -m as invalid operator
please suggest it doing other way.
Thanks
# 4  
Old 07-21-2010
See 4) above
# 5  
Old 07-22-2010
Hi Methyl,
That thing didn't work. I don't know what's wrong happening here
every time i am getting an extra file with a uuencode i,e. attachment
if i attached two files i am getting two more txt files with the name of
subject

(uuencode ./email_text.txt file.txt)|mailx -s"Test" maindola@cisco.com

i am getting two files one is file.txt and Test.txt file.txt is fine but
Test.txt is having values
`end
(uuencode ./email_text.txt file.txt)|mailx -s"Test" maindola@cisco.com<<EOF
echo " "
EOF
i didn't get any attachment i got only body having
echo " " as its content
please help me out i have to implement this thing in my project
so please help me
Regards,
Amit maindola
# 6  
Old 07-22-2010
What Operating System and version are you running?
What Shell are you using (e.g. ksh, bash etc.).

I can reproduce your problem by not using the "-m" switch to "mailx". If your mailx is rejecting "-m" we need to know what Operating System you have.
# 7  
Old 07-22-2010
Bug

Hi Methyl,
I solved the problem, it was with uuencode the os i am using
is Cisco Linux 5.14 a old one modified by Cisco(my company).
actually the uuencode formats a file in a form like this
beging <mode> <filename>
<some code / encryption key>
`
end
I removed the last two ones which are trailers added to them by uuencode
so now i am using it like
(uuencode ./a.txt ab.txt | head -2) | mailx -s "subject" abc@def.com

Thanks for your continuous help
 
Login or Register to Ask a Question

Previous Thread | Next Thread

8 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Content of attachment is displaying along with subject in mailx

Hi All, I want to send the csv to an email address. I have tried the below two approaches. Approach1: Got error -ksh: uuencode: not found $ uuencode test_file.csv test_file.csv | mailx -s "Attaching test" msdc.kiran@gmail.com </usr/home/test_file.csv -ksh: uuencode: not found Approach2:... (6 Replies)
Discussion started by: ROCK_PLSQL
6 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. UNIX for Dummies Questions & Answers

coming out from vi editior

Hi Folks, I have opened a log file through Vi editor in putty itself and I was searching for a pattern in logs , let say 'ABCD' /abcd then I want to come out from vi editor, Please advise what is the command to come out from unix editor..! (1 Reply)
Discussion started by: KAREENA18
1 Replies

4. Emergency UNIX and Linux Support

syslog not coming up

Hi All, I have a whole root zone, tsesbd02-zesbx01. On this zone, syslog service is not coming up. While it is working good on Global zone. Below are commands from tsesbd02-zesbx01 root@tsesbd02-zesbx01:/# svcs -a svc:/system/system-log:default svcs: -a ignored when used with arguments.... (13 Replies)
Discussion started by: solaris_1977
13 Replies

5. 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

6. UNIX for Dummies Questions & Answers

Getting same exit status for empty and non empty file

Hi All, I am checking for a empty input file to do some further action , but I am getting exit status 0 in both the cases , for empty and non empty file both. The value of $? is coming 0 in if part also and else part too. #!/bin/ksh if ]; then echo "data" # exit 0 echo "$?" else... (4 Replies)
Discussion started by: mavesum
4 Replies

7. UNIX for Dummies Questions & Answers

how to find empty folders without using -empty

hi all: my solaris FIND does not support find myFolder -type d -empty how can i find the empty folders? thanks! (7 Replies)
Discussion started by: lasse
7 Replies

8. Red Hat

Sendmail help on RH 9 - going out but NOT coming in..

Is there not one of us who can help here?? I'm really letting down my pants here - not sure what's going on but if you could foreward this link to a group you may know I would greatly appreciate it. I'm getting this error: May 30 22:18:35 MYSERVERNAME sendmail: j4V2HWka015549: ... (1 Reply)
Discussion started by: angelohl
1 Replies
Login or Register to Ask a Question