thanks...
I would normally like to send an excel sheet as an attachment.
would this command work out for that....or do I need mutt..?
Main Topics
Browse All Topicscan someone help with the script/command required to send a mail with attachment from a UNIX server to Windows mailbox.Is there any additional configuration that needs be done on the UNIX box for this ?
This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.
Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.
If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.
Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.
Access the answers to your technology questions today.
30-day free trial. Register in 60 seconds.
Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Try it out and discover for yourself.
30-day free trial. Register in 60 seconds.
Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.
Thanks all...I am able to send mail with attachement.
Is there any way that it can be automated ?as in....at a particular time of the day a mail is fired to a mail address with the daily excel as an attachement ?This daily excel has a particular format ie.rptjul1309...a simialar file is created for each day with the suitable date...
- you can create a shell script e.g. myscript that contains
/usr/bin/uuencode /path/to/sheet.xls sheet.xls | /usr/bin/mailx -s "put subject here" username@domain.com
- make the script executable
chmod +x /path/to/myscript
- create a crontab job
crontab -l > mycrom
echo '0 21 * * * /path/to/myscript' > mycron
crontab mycron
here the script will run daily at 9:00 PM
for more help run
man crontab
export RPTNAME="rpt$(date +%b%d%g).xls"
This line is creating the name of the file form the current date. For today the name will be:
rptJul1309.xls
%b means short month name such as Jan, Jul, Oct etc.
%d means the day part of the date in the format 00..31
%g means two digit year 00.99
So the name is created. then it will uuencodeand send the named file with the next line:
uuencode $RPTNAME $RPTNAME | mailx -s "Contains report file $RPTNAME" user@example.com
thanks...
I already have a script for modifying the attachement name as per the date.
I would like to know how can I send the two attachments(excel) from two different locations in one mail.And since these are excel files in binary format, any mechanism to convert the binary to excel format for easy viewing.
@rvsBhanu
> I would like to know how can I send the two attachments(excel) from two different locations in one
> mail
Did you notice the encoding part in my script:
the line 2 sends the file in /path/to/file/devidrpt${rp
while the line 3 sends /ot/path/to/nondevidrpt${R
As you see you can modify the paths as you wish.
> And since these are excel files in binary format, any mechanism to convert the binary to excel format for easy viewing.
You've lost me completely. Yes excel files are in binary format. There is no such thing as non-binary excel format. Do you mean CSV (Acronym for Comma Separated Values) when you say binary to excel format ? Or do you mean you need some your binary to .xls format? Then what is the format that your binaries are kept? What application generates it? May be this application has a facility to export in CSV instead of .xls so that you can view the daa in nan ordinary text editor. Furthermore excel can import CSV files into spreadsheets.
SCRIPT:
#!/bin/csh
RPTNAME="$(date +%b%d%g)"
export RPTNAME
mailx -s "Contains report file $RPTNAME" me@mymail.com << END
$(uuencode /path/to/file/devidrptJul1
$(uuencode /path/to /file/nondevidrptJul1509${
#
--------------------------
Error:
Variable syntax
--------------------------
Can you pls check this ?Also I would like to know that if the filenames remains fixed,would this work in that scenario also..?If not,can you pls tell me what needs to be done for that ?
Business Accounts
Answer for Membership
by: KeremEPosted on 2009-07-12 at 06:50:58ID: 24834398
Hi,
If all you would like to send as an attachement is a file and you don't need MIME encoded attachement you can do it like that:
uuencode reports.tar.gz reports.tar.gz | mailx -s "My Report" user@yourcorp.com
Or
$ (cat mymessage.txt; uuencode file1.jpeg file2.jpeg) | mail -s "Subject" user@example.com
Bif you need MIME than you need to use some program like mutt.
Cheers,
K.