Sponsored Content
Top Forums Shell Programming and Scripting Sending a file as an attachment to email Post 302753491 by skatpally on Wednesday 9th of January 2013 12:16:14 AM
Old 01-09-2013
Sending a file as an attachment to email

The file is located under appl/batchdata/
file name: storesales.txt
I am using following code because uuencode is not present. I am not getting the data in file but i am getting the blank file with same name as an email attachment.
Code:
( echo "from: sch@xxxx.com"
  echo "to:sch@xxxx.com"
  echo "subject:Store Sales Feed Commission Report for $TODAYDATE"
  echo "mime-version: 1.0"
  echo "content-type: multipart/related; boundary=xxxRANDOMSTRINGxxx"
  echo
  echo "--xxxRANDOMSTRINGxxx"
  echo "content-type: text/plain"
  echo
  echo "Store Sales Feed  for the previous day is listed below:"
  echo
  echo "--xxxRANDOMSTRINGxxx"
cd /appl/batchdata/outgoing/commission/dev/
  echo "content-type: text; name=storesales.txt"
  echo "content-transfer-encoding: base64"
  echo
  openssl base64 <mail.success ) | /usr/lib/sendmail   -t -i "sch@xxxx.com"


Last edited by Franklin52; 01-09-2013 at 03:52 AM.. Reason: Please use code tags for data and code samples
 

10 More Discussions You Might Find Interesting

1. Programming

C code for Sending Email with attachment

Hi, I need the C code for Sending Email with attachment through SMTP protocol, running under linux platform. Thanks (1 Reply)
Discussion started by: Mr coder
1 Replies

2. Shell Programming and Scripting

sending an attachment through email

As a part of requirement I need to send out mails with attachment from UNIX. I have to take query the Oracle DB and send the result of the query in an attachment through mail. I use the following script for the same. #!/bin/csh #!/bin/bash #!/bin/ksh ATTFILE=/folder1/test.xls cd... (1 Reply)
Discussion started by: Sgiri1
1 Replies

3. Shell Programming and Scripting

Sending Email with Attachment

Hi, I want to send an email with multiple attachment using uuencode and mail command. I am able to send with one attachment Ex:uuencode abc.txt abc.txt | mail test@test.com -s "Test3" Can anyone reply with syntax. Regards BS (3 Replies)
Discussion started by: balajiora
3 Replies

4. Shell Programming and Scripting

Sending email and attachment file using Perl

I am trying to send an email body of information and also attachment using perl script, but I am only able to send the body but not an attachment. is there around it without using "use MIME::Lite;" module. $user = "bataf\@xyz.com"; $subjectt = "mail from perl"; open(MAIL, "| mailx -s... (1 Reply)
Discussion started by: bataf
1 Replies

5. UNIX for Dummies Questions & Answers

Sending email with attachment and body

Hi I want to able to attach a file to a email and send it with a body the body of the email is within the "body" file, and the attachment in "atch" if i send like below it will send the email correctly /usr/sbin/sendmail me@you.com< body And when i send the attachment alone... (3 Replies)
Discussion started by: sridanu
3 Replies

6. Shell Programming and Scripting

sending an email with attachment

Hi, Please help me in sending an e-mail with attachment through unix mailx command is not present in our unix box. (4 Replies)
Discussion started by: dudd9
4 Replies

7. Shell Programming and Scripting

Help needed for sending email attachment

Hi Please help me how to send email attchment from linux server to outlook id I dont have uuencode or mutt installed on my machine and below is my uname -a output: Linux xxxxxxx 2.6.18-308.4.1.el5 #1 SMP Wed Mar 28 01:54:56 EDT 2012 x86_64 x86_64 x86_64 GNU/Linux (7 Replies)
Discussion started by: buzzme
7 Replies

8. Shell Programming and Scripting

Sending attachment with email without using uuencode and mutt

Hi All, do we have any option for sending attachment with email except using uuencode and mutt, because if i use these utilities then i will have to install them separately which is not feasible at time. please suggest on this. (2 Replies)
Discussion started by: lovelysethii
2 Replies

9. Red Hat

Sending email with message body and attachment

Hello experts!! I am trying to send an email with message body and attachment.but i am getting any one like message body or attachment. I tried below command: (echo "subject:test";echo "MIME-Version: 1.0";echo "content-transfer-encoding:base 64";echo "content-type:txt;name=test.txt";cat... (2 Replies)
Discussion started by: Devipriya Ch
2 Replies

10. UNIX for Beginners Questions & Answers

MIME type for sending gzip file as attachment in email

Hello, I am trying to send a gzip file on email using below command but the zipped file received on email is corrupt. mailsend -smtp $smtpip -content-type 'application/x-gzip' -mime-type "application/x-gzip" -t $receiver -f $sender -sub "$subject" -M "$MSG" -attach $file file name is ... (1 Reply)
Discussion started by: tushar.modgil
1 Replies
uuencode(1)							   User Commands						       uuencode(1)

NAME
uuencode - encode a file into email friendly text SYNOPSIS
uuencode [-flag [value]]... [--opt-name[[=| ]value]]... [ in-file ] output-name DESCRIPTION
uuencode is used to create an ASCII representation of a file that can be sent over channels that may otherwise corrupt the data. Specifi- cally, email cannot handle binary data and will often even insert a character when the six character sequence "0rom " is seen. uuencode will read in-file if provided and otherwise read data from standard in and write the encoded form to standard out. The output will begin with a header line for use by uudecode giving it the resulting suggested file output-name and access mode. If the output-name is specifi- cally /dev/stdout, then uudecode will emit the decoded file to standard out. 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. OPTIONS
-m, --base64 convert using base 64. By default, uuencode will encode using the traditional conversion. It is slower and less compact than base 64. 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). -e, --encode-file-name encode the output file name. Since output file names may contain characters that are not handled well by various transmission modes, you may specify that the output-name be hex encoded as well. -h, --help Display usage information and exit. -!, --more-help Pass the extended usage information through a pager. -R [rcfile], --save-opts[=rcfile] Save the option state to rcfile. The default is the last configuration file listed in the OPTION PRESETS section, below. -r rcfile, --load-opts=rcfile, --no-load-opts Load options from rcfile. The no-load-opts form will disable the loading of earlier RC/INI files. --no-load-opts is handled early, out of order. -v [{v|c|n}], --version[={v|c|n}] Output version of program and exit. The default mode is `v', a simple version. The `c' mode will print copyright information and `n' will print the full copyright notice. OPTION PRESETS
Any option that is not marked as not presettable may be preset by loading values from configuration ("RC" or ".INI") file(s). The file "$HOME/.sharrc" will be used, if present. STANDARDS
This implementation is compliant with P1003.2b/D11. FILES
See OPTION PRESETS for configuration files. EXIT STATUS
One of the following exit values will be returned: 0 (EXIT_SUCCESS) Successful program execution. 1 (EXIT_FAILURE) The operation failed or the command syntax was not valid. 66 (EX_NOINPUT) A specified configuration file could not be loaded. 70 (EX_SOFTWARE) libopts had an internal operational error. Please report it to autogen-users@lists.sourceforge.net. Thank you. SEE ALSO
uudecode(1) HISTORY
The uuencode command first appeared in BSD 4.0. AUTHORS
Free Software Foundation, Inc. COPYRIGHT
Copyright (C) 1994-2013 Free Software Foundation, Inc. all rights reserved. This program is released under the terms of the GNU General Public License, version 3 or later. BUGS
Please put sharutils in the subject line for emailed bug reports. It helps to spot the message. The output file name must not begin with the 11 character sequence: hex-encode: unless you specify the -h (encode-file-name) option. Please send bug reports to: bug-gnu-utils@gnu.org NOTES
This manual page was AutoGen-erated from the uuencode option definitions. GNU sharutils (4.13.3) 06 Jan 2013 uuencode(1)
All times are GMT -4. The time now is 10:49 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy