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)						      General Commands Manual						       uuencode(1)

NAME
uuencode, uudecode - encode a binary file, or decode its representation SYNOPSIS
uuencode [-m] [ file ] name uudecode [-o outfile] [ file ]... DESCRIPTION
Uuencode and uudecode are used to transmit binary files over channels that support only simple ASCII data. Uuencode reads file (or by default the standard input) and writes an encoded version to the standard output, using only printable ASCII characters. The encoded output begins with a header, for use by uudecode, which records the mode of the input file and suggests name for the decoded file that will be created. (If name is /dev/stdout then uudecode will decode to standard output.) The encoding has the format documented at uuencode(5), unless the option -m is given, when base64 encoding is used instead. Note: uuencode uses buffered input and assumes that it is not hand typed from a tty. The consequence is that at a tty, you may need to hit Ctl-D several times to terminate input. Uudecode transforms uuencoded files (or standard input) into the original form. The resulting file is named name (or outfile if the -o option is given) and will have the mode of the original file except that setuid and execute bits are not retained. If outfile or name is /dev/stdout the result will be written to standard output. Uudecode ignores any leading and trailing lines. The program determines from the header which of the two supported encoding schemes was used. EXAMPLES
The following example packages up a source tree, compresses it, uuencodes it and mails it to a user on another system. When uudecode is run on the target system, the file ``src_tree.tar.Z'' will be created which may then be uncompressed and extracted into the original tree. tar cf - src_tree | compress | uuencode src_tree.tar.Z | mail sys1!sys2!user SEE ALSO
compress(1), mail(1), uucp(1), uuencode(5) STANDARDS
This implementation is compliant with P1003.2b/D11. BUGS
If more than one file is given to uudecode and the -o option is given or more than one name in the encoded files are the same the result is probably not what is expected. The encoded form of the file is expanded by 37% for UU encoding and by 35% for base64 encoding (3 bytes become 4 plus control information). REPORTING BUGS
Report bugs to <bug-gnu-utils@gnu.org>. Please put sharutils or uuencode in the subject line. It helps to spot the message. HISTORY
The uuencode command appeared in BSD 4.0. uuencode(1)