Sponsored Content
Full Discussion: Attach file in mailx command
Top Forums Shell Programming and Scripting Attach file in mailx command Post 302521074 by Himanshu_soni on Tuesday 10th of May 2011 07:03:13 AM
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..
 

10 More Discussions You Might Find Interesting

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

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

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

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

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

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

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

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

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

10. 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
fmt(1)							      General Commands Manual							    fmt(1)

NAME
fmt - Formats mail messages prior to sending SYNOPSIS
fmt [-width] file... DESCRIPTION
The fmt command reads the input file or files, or standard input if no files are specified, and writes to standard output a version of the input with lines of a length as close as possible to width columns. (Because fmt is internationalized software, the number of display col- umns is not necessarily equivalent to the number of bytes.) The fmt command both joins and splits lines to achieve the desired width, but words are never joined or split; spaces are always preserved, and lines are split at spaces only. In effect, fmt ignores newline characters in the input and wraps words to make lines a close as possi- ble to width columns, resulting in individual lines of varying length but a consistent (new) text width overall. Because blank lines are always preserved, fmt does not merge paragraphs separated by blank lines. If you specify more than one file, the files are concatenated as input to fmt. If you do not specify -width, the default line length is 72 columns. Spacing at the beginning of input lines is always preserved in the output. The fmt command is generally used to format mail messages to improve their appearance before they are sent. It may also be useful, how- ever, for other simple formatting tasks. For example, when you are using vi, you can use the command :%!fmt -60 to reformat your text so that all lines are approximately 60 columns long. NOTES
The fmt command is a fast, simple formatting program. Standard text editing programs are more appropriate than fmt for complex formatting operations. Do not use the fmt command if the message contains embedded messages or preformatted information from other files. This com- mand formats the heading information in embedded messages and may change the format of preformatted information. EXAMPLES
file1 contains these lines: Australia is an island-continent, home to many very interesting plants and animals. To reformat this text to a narrower width, enter: fmt -30 file1 This results in the following, displayed on your screen: Australia is an island-continent, home to many very interesting plants and animals. To make file1 wider, enter: fmt -60 file1 This results in: Australia is an island-continent, home to many very interesting plants and animals. To format a message you have created with the mailx editor, at the left margin enter: ~|fmt After you enter the command, your message is formatted, in this case to the default line length of 72 columns, and the word continue is displayed to indicate that you can enter more information or send your message. SEE ALSO
Commands: mail(1), mailx(1), vi(1) fmt(1)
All times are GMT -4. The time now is 04:04 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy