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(n)					       Text encoding & decoding binary data					       uuencode(n)

__________________________________________________________________________________________________________________________________________________

NAME
uuencode - UU-encode/decode binary data SYNOPSIS
package require Tcl 8 package require uuencode ?1.1.4? ::uuencode::encode string ::uuencode::decode string ::uuencode::uuencode ?-name string? ?-mode octal? (-file filename | ?--? string) ::uuencode::uudecode (-file filename | ?--? string) _________________________________________________________________ DESCRIPTION
This package provides a Tcl-only implementation of the uuencode(1) and uudecode(1) commands. This encoding packs binary data into printable ASCII characters. ::uuencode::encode string returns the uuencoded data. This will encode all the data passed in even if this is longer than the uuencode maximum line length. If the number of input bytes is not a multiple of 3 then additional 0 bytes are added to pad the string. ::uuencode::decode string Decodes the given encoded data. This will return any padding characters as well and it is the callers responsibility to deal with handling the actual length of the encoded data. (see uuencode). ::uuencode::uuencode ?-name string? ?-mode octal? (-file filename | ?--? string) ::uuencode::uudecode (-file filename | ?--? string) UUDecode a file or block of data. A file may contain more than one embedded file so the result is a list where each element is a three element list of filename, mode value and data. OPTIONS
-filename name Cause the uuencode or uudecode commands to read their data from the named file rather that taking a string parameter. -name string The uuencoded data header line contains the suggested file name to be used when unpacking the data. Use this option to change this from the default of "data.dat". -mode octal The uuencoded data header line contains a suggested permissions bit pattern expressed as an octal string. To change the default of 0644 you can set this option. For instance, 0755 would be suitable for an executable. See chmod(1). EXAMPLES
% set d [uuencode::encode "Hello World!"] 2&5L;&\@5V]R;&0A % uuencode::uudecode $d Hello World! % set d [uuencode::uuencode -name hello.txt "Hello World"] begin 644 hello.txt +2&5L;&@5V]R;&0` ` end % uuencode::uudecode $d {hello.txt 644 {Hello World}} BUGS, IDEAS, FEEDBACK This document, and the package it describes, will undoubtedly contain bugs and other problems. Please report such in the category base64 of the Tcllib SF Trackers [http://sourceforge.net/tracker/?group_id=12883]. Please also report any ideas for enhancements you may have for either package and/or documentation. KEYWORDS
encoding, uuencode CATEGORY
Text processing COPYRIGHT
Copyright (c) 2002, Pat Thoyts base64 1.1.4 uuencode(n)