How to "sendmail" with xls attachment , without using uuencode?


 
Thread Tools Search this Thread
Top Forums UNIX for Beginners Questions & Answers How to "sendmail" with xls attachment , without using uuencode?
# 1  
Old 03-11-2020
How to "sendmail" with xls attachment , without using uuencode?

Hi ,
I have a script that uses sendmail , it has some html tags for the body, hence i am using sendmail.
Script works fine with uuencode , however i found that production environment doesnt support uuencode.

i tried openssl base64 < xlsfile.xls , the file is corrupted in mail , could you please suggest alternative.

echo 'content-type: application/vnd.ms-excel;name="'$(basename $input_file_name)'"'
echo "content-transfer-encoding: base64"
echo 'content-disposition:attachment;filename="'$(basename $input_file_name)'"'
openssl base64 < $input_file_name

Last edited by sowbarnika; 03-11-2020 at 04:40 AM.. Reason: Issue is fixed , seems i missed echo before openssl
Login or Register to Ask a Question

Previous Thread | Next Thread

9 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

Bash script - Print an ascii file using specific font "Latin Modern Mono 12" "regular" "9"

Hello. System : opensuse leap 42.3 I have a bash script that build a text file. I would like the last command doing : print_cmd -o page-left=43 -o page-right=22 -o page-top=28 -o page-bottom=43 -o font=LatinModernMono12:regular:9 some_file.txt where : print_cmd ::= some printing... (1 Reply)
Discussion started by: jcdole
1 Replies

2. UNIX for Dummies Questions & Answers

Using "mailx" command to read "to" and "cc" email addreses from input file

How to use "mailx" command to do e-mail reading the input file containing email address, where column 1 has name and column 2 containing “To” e-mail address and column 3 contains “cc” e-mail address to include with same email. Sample input file, email.txt Below is an sample code where... (2 Replies)
Discussion started by: asjaiswal
2 Replies

3. AIX

How to send attachment using "sendmail" command or without uuencode command

Hi Guys, I dont have uuencode, mutt, base64 command available on my aix machine there is any alternative way to send file as attachement in mail. (1 Reply)
Discussion started by: ns64110
1 Replies

4. Shell Programming and Scripting

How to send attachment using "sendmail" command or without uuencode command

Hi Guys, I dont have uuencode, mutt, base64 command available on my aix machine there is any alternative way to send file as attachement in mail. (3 Replies)
Discussion started by: ns64110
3 Replies

5. UNIX for Advanced & Expert Users

Sendmail: how to restrict delivery based on "to" or "from"?

Hello, I manage a large sendmail server that handles more than 20,000 pieces of mail per day. It's a bit unusual in that all this mail is only being sent to and from 4 local accounts. (It's an automated transaction processing system, whereby users submit a transaction via email attachment). ... (2 Replies)
Discussion started by: lupin..the..3rd
2 Replies

6. Shell Programming and Scripting

awk command to replace ";" with "|" and ""|" at diferent places in line of file

Hi, I have line in input file as below: 3G_CENTRAL;INDONESIA_(M)_TELKOMSEL;SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL My expected output for line in the file must be : "1-Radon1-cMOC_deg"|"LDIndex"|"3G_CENTRAL|INDONESIA_(M)_TELKOMSEL"|LAST|"SPECIAL_WORLD_GRP_7_FA_2_TELKOMSEL" Can someone... (7 Replies)
Discussion started by: shis100
7 Replies

7. Linux

Need resolution for the command "UUENCODE"

HI, I'm getting the following error while using "uuencode" -bash: uuencode: command not found I assume either the path is missing or it has not installed.. 1)Wat is the command to check the path for uuencode if it has been installed..? 2)How to install uuencode if its not... (7 Replies)
Discussion started by: vickramshetty
7 Replies

8. UNIX for Dummies Questions & Answers

How to send multiple attachment through "nail" command

Hi, I using the "nail" command to send an attachement,the command is : nail -s TEST -a $param/Result.html xyz@yahoo.com </dev/null but now my requirement is changed, I have to send two attachments,through the same mail.. :rolleyes: I have tried this: nail -s TEST -a $param/*.html... (1 Reply)
Discussion started by: Amey Joshi
1 Replies

9. UNIX for Dummies Questions & Answers

Explain the line "mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'`"

Hi Friends, Can any of you explain me about the below line of code? mn_code=`env|grep "..mn"|awk -F"=" '{print $2}'` Im not able to understand, what exactly it is doing :confused: Any help would be useful for me. Lokesha (4 Replies)
Discussion started by: Lokesha
4 Replies
Login or Register to Ask a Question
UUENCODE(1)						    BSD General Commands Manual 					       UUENCODE(1)

NAME
uuencode, uudecode -- encode/decode a binary file SYNOPSIS
uuencode [-m] [inputfile] outputname uudecode [-m | -p] [encoded-file ...] DESCRIPTION
uuencode and uudecode are used to transmit binary files over transmission mediums that do not support other than simple ASCII data. The following options are available: -m Use base64 encoding. uuencode reads inputfile (or by default the standard input) and writes an encoded version to the standard output. The encoding uses only printing ASCII characters and includes the mode of the file and the operand outputname for use by uudecode. uudecode transforms uuencoded files (or by default, the standard input) into the original form. The resulting file is named outputname as recorded in the encoded file, and will have the mode of the original file except that setuid and execute bits are not retained; if the -p option is specified, the data will be written to the standard output instead. uudecode ignores any leading and trailing lines. EXIT STATUS
The uudecode and uuencode utilities exits 0 on success, and >0 if an error occurs. EXAMPLES
The following example packages up a source tree, compresses it, uuencodes it and mails it to a user on another system. tar czf - src_tree | uuencode src_tree.tgz | mail user@example.com On the other system, if the user saves the mail to the file temp, the following example creates the file src_tree.tgz and extracts it to make a copy of the original tree. uudecode temp tar xzf src_tree.tgz SEE ALSO
gzip(1), mail(1), tar(1), uuencode(5) STANDARDS
The uudecode and uuencode utilities conform to IEEE Std 1003.2-1992 (``POSIX.2''). HISTORY
The uudecode and uuencode utilities appeared in 4.0BSD. BUGS
The encoded form of the file is expanded by 35% (3 bytes become 4 plus control information). BSD
November 30, 2008 BSD