Attach file in mailx command | Unix Linux Forums | Shell Programming and Scripting

  Go Back    


Shell Programming and Scripting Post questions about KSH, CSH, SH, BASH, PERL, PHP, SED, AWK and OTHER shell scripts and shell scripting languages here.

Attach file in mailx command

Shell Programming and Scripting


Closed Thread    
 
Thread Tools Search this Thread Display Modes
    #1  
Old 05-10-2011
Himanshu_soni Himanshu_soni is offline
Registered User
 
Join Date: Jan 2011
Last Activity: 10 May 2011, 9:08 AM EDT
Posts: 17
Thanks: 4
Thanked 0 Times in 0 Posts
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:
Please use [CODE] tags when posting command lines, listings, ...

Last edited by pludi; 05-10-2011 at 07:17 AM..
Sponsored Links
    #2  
Old 05-10-2011
methyl methyl is offline Forum Advisor  
Advisor
 
Join Date: Mar 2008
Last Activity: 18 April 2014, 5:13 AM EDT
Posts: 6,396
Thanks: 287
Thanked 671 Times in 642 Posts
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 07:41 AM..
Sponsored Links
    #3  
Old 05-10-2011
pludi's Avatar
pludi pludi is offline Forum Advisor  
Cat herder
 
Join Date: Dec 2008
Last Activity: 28 March 2014, 8:35 AM EDT
Location: Vienna, Austria, Earth
Posts: 5,522
Thanks: 38
Thanked 335 Times in 308 Posts
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.
The Following User Says Thank You to pludi For This Useful Post:
Himanshu_soni (05-10-2011)
Sponsored Links
Closed Thread

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
How to split a csv file and zip it and attach using mutt command? Jassz Shell Programming and Scripting 0 01-03-2011 06:04 AM
Can not attach using mailx ultimatix Shell Programming and Scripting 10 10-20-2010 09:14 AM
Mailx: How to send a attachment using mailx command Sriram.Vedula53 Shell Programming and Scripting 3 02-19-2010 04:12 AM
How to attach a file in Linux mail command rohit22hamirpur Shell Programming and Scripting 1 12-05-2008 12:58 AM
attach 2 files using mailx anumkoshy Shell Programming and Scripting 2 08-27-2007 01:37 AM



All times are GMT -4. The time now is 10:31 AM.