Visit The New, Modern Unix Linux Community

Can not attach using mailx

Thread Tools Search this Thread
Top Forums Shell Programming and Scripting Can not attach using mailx
# 1  
Bug Can not attach using mailx


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

cat 1.csv | mailx -s "TEST" ""

I am getting the mail , but the contents of attcahment are on the bodu of mail .
I want the mail with 1.csv as attachment

Pls advise .

# 2  
uuencode 1.csv 1.csv | mailx -s "TEST" ""

# 3  

Thanks mate .. u made my evening Smilie

---------- Post updated at 08:31 PM ---------- Previous update was at 07:53 AM ----------

Any ideas as to how do i add a body to this messsgae ..


uuencode xyz.csv xyz.csv | mailx -s "Subject" ""

# 4  
As usual, it always helps to know what Operating System you are using today.

Here is a broad solution for most modern unixes: Adjust for your local syntax.

(cat mailbody.txt ; ux2dos xyz.csv | uuencode xyz.csv ) | mailx -m -s "Subject" ""

# 5  

I am using Sun Solaris ..

Tried this .. not working ...

(cat mailbody.txt) ; uuencode 12-MAY-10.csv uuencode 12-MAY-10.csv | mailx -s "Explained" ""

No ux2dos on my system

Last edited by ultimatix; 10-18-2010 at 08:46 AM.. Reason: ux2dos update
# 6  
The parentheses allow us to execute a sequence of unix commands separated by ";" , then present the whole output to "mailx".
The position of the parentheses is critical.
Also you have the word "uuencode" in the line twice.

The equivalent of "ux2dos" appears to be "unix2dos" on Solaris.
You've removed the "-m" switch from the "mailx". I assume that it is not valid on your Solaris. I'd like to check but the website has collapsed in a heap today.

(cat mailbody.txt ; unix2dos 12-MAY-10.csv | uuencode 12-MAY-10.csv) | mailx -s "Explained" ""

# 7  

Hi Methyl

It worked perfect . Mial delivedred with attachment but got this error mesg on terminal

Can this be suppressed .. I am using Ksh

could not open /dev/kbd to get keyboard type US keyboard assumed
could not get keyboard type US keyboard assumed

Previous Thread | Next Thread
Thread Tools Search this Thread
Search this Thread:
Advanced Search

Test Your Knowledge in Computers #34
Difficulty: Medium
When a computer is first powered on, the special type of absolute loader is known as the pre-boot loader.
True or False?

9 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

Attach file in mailx command

Hi I want ot send a mail with aatach a file for this i have tried mailx -s "COMPLETED:" -a root/usr/local/bin/sched/nightly_Cronjob/test.out me@nowhere uuencode /usr/local/bin/sched/nightly_Cronjob/test.out /usr/local/bin/sched/nightly_Cronjob/test.out | mailx -s "COMPLETED:... (2 Replies)
Discussion started by: Himanshu_soni
2 Replies

3. 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:" -a /usr/local/bin/test.out me@nowhere uuencode /usr/local/bin/test.out /usr/local/bin/test.out | mailx -s "COMPLETED:" me@nowhere but of command is not working. so is there any... (0 Replies)
Discussion started by: Himanshu_soni
0 Replies

4. Emergency UNIX and Linux Support

xm block-attach

Hi guys. I'm studding XEN virtualization with 'The Book Of XEN'. in page 46 it has a statement about how to use xm block-attach command that I don't understand. here is the command: xm block-attach 0 tap:aio:/opt/xen/anthony.img /dev/xvda1 w 0and here is sentence: we are attaching anthony.img... (1 Reply)
Discussion started by: majid.merkava
1 Replies

5. Solaris

Help with Update on attach

Hi All, Can any-one explain me how update on attach works on solaris zones. Here is the situation . I am trying to migrate a zones xx-xxx-xxx from Global zone A to Global zone B. Here is the error message zoneadm is displaying zoneadm: zone 'xx-xx-xxx': ERROR: attempt to downgrade... (0 Replies)
Discussion started by: rama krishna
0 Replies

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

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

8. UNIX for Dummies Questions & Answers

mailx error message : mailx: NUL changed to @

If I use the "Mail" link instead of the "mail" link to ../mailx I get this error. Mail so-n-so mailx: NUL changed to @ Unknown command: "postmaster" The email still goes through but i get the error. If I use "mail" it goes thru without the error. Any ideas?? (2 Replies)
Discussion started by: BG_JrAdmin
2 Replies

9. UNIX for Advanced & Expert Users

pine does'nt attach files

Hello All, I am maintaining a server and I use pine as MUA and sendmail as MTA. Suddenly many users in the network face the problem of not being able to attach files using pine. I checked the file and found a variable "MaxMessageSize = 1000000". Eventhough the message size... (2 Replies)
Discussion started by: maybemedic
2 Replies

Featured Tech Videos