Attach file in mailx command


 
Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Attach file in mailx command
# 1  
Old 05-10-2011
Attach file in mailx command

Hi
I want ot send a mail with aatach a file for this i have tried

Code:
mailx -s "COMPLETED: deal.sh" -a root/usr/local/bin/sched/nightly_Cronjob/test.out me@nowhere

Code:
uuencode /usr/local/bin/sched/nightly_Cronjob/test.out /usr/local/bin/sched/nightly_Cronjob/test.out | mailx -s "COMPLETED: deal.sh" me@nowhere

but of command is not working. so is there any otner way to send a mail with attachment.

Thanks in advance

Moderator's Comments:
Mod Comment Please use [CODE] tags when posting command lines, listings, ...

Last edited by pludi; 05-10-2011 at 08:17 AM..
# 2  
Old 05-10-2011
Quote:
uuencode /usr/local/bin/sched/nightly_Cronjob/test.out /usr/local/bin/sched/nightly_Cronjob/test.out | mailx -s "COMPLETED: deal.sh" me@nowhere
First reaction is to give the attachment a valid MS-DOS name.
Code:
uuencode /usr/local/bin/sched/nightly_Cronjob/test.out myattach.txt | mailx -s "COMPLETED: deal.sh" me@nowhere

And to consider converting the attachment to MS-DOS format.
Code:
ux2dos /usr/local/bin/sched/nightly_Cronjob/test.out | uuencode myattach.txt | mailx -s "COMPLETED: deal.sh" me@nowhere

Failing that, please mention what Operating System and Shell you are using and describe what happens.

Does mailx without an attachment work?
What mail reader are you using?

Last edited by methyl; 05-10-2011 at 08:41 AM..
# 3  
Old 05-10-2011
This question has been asked so often it has it's own FAQ section here. Please use the search feature first, especially for questions that everyone sooner or later encounters.
This User Gave Thanks to pludi For This Post:
Login or Register to Ask a Question

Previous Thread | Next Thread

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Unable to attach a .txt file or .log file to mail and mailx command

Hi, I am trying to attach a .log file or .txt file to mail command to send an email once my ksh script executed. I am unable to use mutt command as it has been not installed and i am not supposed to install it. I have tried many ways by googling which has not helped me to succeed. Here is my... (5 Replies)
Discussion started by: Samah
5 Replies

2. Shell Programming and Scripting

Mailx command to send attachment file

Hi, I need to send a attachment which has space in the file name as: "ABC Data Extract.txt" which is present in the location /home/projects/txt i am using /home/projects/scripts mailx -s "Sub" email_id "/home/projects/txt/ABC Data Extract.txt" but i am not getting the attachment. (7 Replies)
Discussion started by: ATWC
7 Replies

3. Shell Programming and Scripting

want to send .csv file as an attachment using mailx command.

want to send .csv file as an attachment using mailx command. Please help!!! (1 Reply)
Discussion started by: gagandeep
1 Replies

4. Shell Programming and Scripting

How to attach multiple file to send mail command

Hi, i want color effect on mail as well as multiple attachment.I have code but this code is used for single attachment. I am unable to attach more than one file.:wall: I want to send two attachments -ahmed.csv and ahmed1.csv . Sample content: <html> <body> <b> Hi...</b> </body> </html> ... (1 Reply)
Discussion started by: AhmedLakadkutta
1 Replies

5. Shell Programming and Scripting

Attach file in mailx command

Hi I want ot send a mail with aatach a file for this i have tried mailx -s "COMPLETED: deal.sh" -a /usr/local/bin/test.out me@nowhere uuencode /usr/local/bin/test.out /usr/local/bin/test.out | mailx -s "COMPLETED: deal.sh" me@nowhere but of command is not working. so is there any... (0 Replies)
Discussion started by: Himanshu_soni
0 Replies

6. Shell Programming and Scripting

How to split a csv file and zip it and attach using mutt command?

We need to redirect the output of a query to .csv file each containing a specified number of lines.Then we should zip these files and send as attachment using mutt command. We tried using split -l 500 query_output.txt outputfile Since we are not sure about the exact number of files... (0 Replies)
Discussion started by: Jassz
0 Replies

7. Shell Programming and Scripting

Can not attach using mailx

hi I know this topic has been discussed a lot in the forum but still couldnt get a exact solution to problem i am facing I have a CSV file genertaed on Unix box and want to be sent to my email . mailx -s "TEST" "xyz@hotmail.com" < 1.csv cat 1.csv | mailx -s "TEST" "xyz@hotmail.com" ... (10 Replies)
Discussion started by: ultimatix
10 Replies

8. Shell Programming and Scripting

Mailx: How to send a attachment using mailx command

Hi All, Can anyone please provide the command for sending an mail with attachment using mailx command. Thanks in Advance :) Regards, Siram. (3 Replies)
Discussion started by: Sriram.Vedula53
3 Replies

9. Shell Programming and Scripting

How to attach a file in Linux mail command

How to attach a file in Linux mail command Hi Guys, Is there any way to attach a file in Linux mail command without using "uuencode"? i.e. Code: file=/a/b/c/d/file.txtmail -s "Giga aks" abc@123.com <<HDoc`uuencode $file $file 2>/dev/null`HDoc Here, I don;t want to use 'uuencode'... (1 Reply)
Discussion started by: rohit22hamirpur
1 Replies

10. Shell Programming and Scripting

attach 2 files using mailx

if test.dat is the file cat test.dat|uuencode test.dat|mailx -s "subject" mailid can be used for attaching test.dat how can i attach more than one file to a mail using mailx (2 Replies)
Discussion started by: anumkoshy
2 Replies
Login or Register to Ask a Question