Sponsored Content
Top Forums UNIX for Advanced & Expert Users sending mails with attachment and also some text in mail body Post 302074467 by matrixmadhan on Tuesday 23rd of May 2006 11:29:14 AM
Old 05-23-2006
Quote:
Originally Posted by guptan
The input for uuencode is 'unix2dos -ascii $REPORTFILE '
and the output is $PCFILE which is $REPORTFILE.xls
decode_pathname is must

man uuencode
 

10 More Discussions You Might Find Interesting

1. UNIX for Dummies Questions & Answers

Sending attachment thru a mail

Is there any way we can send file attachemnts through mails from a unix server. Does the 'mail' command have such an option ?? (1 Reply)
Discussion started by: Rohini Vijay
1 Replies

2. UNIX for Dummies Questions & Answers

AIX send mail with HTML message body and a binary attachment

I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements: 1. command line switch to specify file name containing message body in HTML format 2. command line switch to specify file name of a binary attachment 3. command line or input file to specify... (4 Replies)
Discussion started by: G-Man
4 Replies

3. AIX

Command line/Script to send E-mail with HTML body and binary attachment

I apoligize for the cross-post but I'm not getting much in the way of help in the dummies forum: I'm trying to script sending an e-mail message on an AIX 5.x server with the following requirements: 1. command line switch to specify file name containing message body in HTML format 2. command... (3 Replies)
Discussion started by: G-Man
3 Replies

4. Shell Programming and Scripting

Not able to attach text in body of email while sending mail with attachment

Hi, We have been trying to send mail with attachment and it is going fine, but when we try to attach a text to the body of the email, we find that the mail is going fine with the body text but the attachment is not going through. We are using ksh. The command that is successfull without the... (6 Replies)
Discussion started by: jmathew99
6 Replies

5. Shell Programming and Scripting

send attachment and body in one mail using mailx

Hi, Our requirement is to send an attachment and content in a single mail. I am using the below command to send attachement. --------------------- (uuencode $exp_file $exp_file) |mailx -s "$email_subject" $EmailRecipients -------------------- I m not able to send any message in the... (4 Replies)
Discussion started by: ashwin3086
4 Replies

6. Shell Programming and Scripting

unix mail body with attachment

How can I send mail with attachment in HP-UX I am able to send mail with specific body,but not successful while attaching a file. I am using the below command however it stuck : uuencode test.txt |mailx -s "Subject" <e-mail id> (5 Replies)
Discussion started by: gautamadak
5 Replies

7. 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

8. UNIX for Advanced & Expert Users

Sending mail with attachment

Hi, I am using Sun solaris OS unix server I am trying to send mail with an attachment using below script cat test.txt;uuencode test.txt test.txt|mailx -s "$subject" someone@somewhere I m getting mails but with no attachment. Hence i manipulate the script as below and i am... (2 Replies)
Discussion started by: sv0081493
2 Replies

9. UNIX for Dummies Questions & Answers

Sending mail in UNIX with body and attachment(.txt) using sendmail command

Hi All, In my .ksh script, I am sending an email with body and attachment (.txt) using sendmail command. I am able to receive the attachement along with the body of the mail. But I am getting special characters along with the content in the .txt. Also the alignment is incorrect. Can you please... (7 Replies)
Discussion started by: KRR
7 Replies

10. 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
uuencode(1C)						      Communication Commands						      uuencode(1C)

NAME
uuencode, uudecode - encode a binary file, or decode its encoded representation SYNOPSIS
uuencode [source-file] decode_pathname uuencode [-m] [source-file] decode_pathname uudecode [-p] [encoded-file] uudecode [-o outfile] [encoded-file] DESCRIPTION
These commands encode and decode files as follows: uuencode The uuencode utility converts a binary file into an encoded representation that can be sent using mail(1). It encodes the contents of source-file, or the standard input if no source-file argument is given. The decode_pathname argument is required. The decode_pathname is included in the encoded file's header as the name of the file into which uudecode is to place the binary (decoded) data. uuencode also includes the permission modes of source-file (except setuid, setgid, and sticky-bits), so that decode_pathname is recreated with those same permission modes. uudecode The uudecode utility reads an encoded-file, strips off any leading and trailing lines added by mailer programs, and recreates the original binary data with the filename and the mode specified in the header. The encoded file is an ordinary portable character set text file; it can be edited by any text editor. It is best only to change the mode or decode_pathname in the header to avoid corrupting the decoded binary. OPTIONS
The following options are supported: uuencode -m Encodes source-file using Base64 encoding and sends it to standard output. uudecode -o outfile Specifies a file pathname that should be used instead of any pathname contained in the input data. Specifying an outfile option-argument of /dev/stdout indicates standard output.This allows uudecode to be used in a pipeline. -p Decodes encoded-file and sends it to standard output. This allows uudecode to be used in a pipeline. OPERANDS
The following operands are supported by uuencode and uudecode: uuencode decode_pathname The pathname of the file into which the uudecode utility will place the decoded file. If there are characters in decode_pathname that are not in the portable filename character set, the results are unspecified. source-file A pathname of the file to be encoded. uudecode encoded-file The pathname of a file containing the output of uuencode. USAGE
See largefile(5) for the description of the behavior of uuencode and uudecode when encountering files greater than or equal to 2 Gbyte ( 2 **31 bytes). ENVIRONMENT VARIABLES
See environ(5) for descriptions of the following environment variables that affect the execution of uuencode and uudecode: LANG, LC_ALL, LC_CTYPE, LC_MESSAGES, and NLSPATH. OUTPUT
stdout uuencode Base64 Algorithm The standard output is a text file, encoded in the character set of the current locale, that begins with the line: begin-base64 %s %s0 mode, decode_pathname and ends with the line: ==== In both cases, the lines have no preceding or trailing blank characters. The encoding process represents 24-bit groups of input bits as output strings of four encoded characters. Proceeding from left to right, a 24-bit input group is formed by concatenating three 8-bit input groups. Each 24-bit input group is then treated as four concatenated 6-bit groups, each of which is translated into a single digit in the Base64 alphabet. When encoding a bit stream by means of the Base64 encoding, the bit stream is presumed to be ordered with the most-significant bit first. That is, the first bit in the stream is the high-order bit in the first byte, and the eighth bit is the low-order bit in the first byte, and so on. Each 6-bit group is used as an index into an array of 64 printable characters, as shown in the following table. Value Encoding Value Encoding Value Encoding Value Encoding 0 A 17 R 34 i 51 z 1 B 18 S 35 j 52 0 2 C 19 T 36 k 53 1 3 D 20 U 37 l 54 2 4 E 21 V 38 m 55 3 5 F 22 W 39 n 56 4 6 G 23 X 40 o 57 5 7 H 24 Y 41 p 58 6 8 I 25 Z 42 q 59 7 9 J 26 a 43 r 60 8 10 K 27 b 44 s 61 9 11 L 28 c 45 t 62 + 12 M 29 d 46 u 63 / 13 N 30 e 47 v 14 O 31 f 48 w (pad) = 15 P 32 g 49 x 16 Q 33 h 50 y The character referenced by the index is placed in the output string. The output stream (encoded bytes) is represented in lines of no more than 76 characters each. All line breaks or other characters not found in the table are ignored by decoding software (see uudecode). Special processing is performed if fewer than 24 bits are available at the end of a message or encapsulated part of a message. A full encoding quantum is always completed at the end of a message. When fewer than 24 input bits are available in an input group, zero bits are added on the right to form an integral number of 6-bit groups. Output character positions that are not required to represent actual input data are set to the equals (=) character. Since all Base64 input is an integral number of octets, only the following cases can arise: 1. The final quantum of encoding input is an integral multiple of 24 bits. Here, the final unit of encoded output is an integral multiple of four characters with no '= ' padding. 2. The final quantum of encoding input is exactly 16 bits. Here, the final unit of encoded output is three characters followed by one '=' padding character. 3. The final quantum of encoding input is exactly 8 bits. Here, the final unit of encoded output is two characters followed by two '=' padding characters. A terminating "====" evaluates to nothing and denotes the end of the encoded data. uuencode Historical Algorithm The standard output is a text file (encoded in the character set of the current locale) that begins with the line: begin %s %s , mode, decode_pathname and ends with the line: end In both cases, the lines have no preceding or trailing blank characters. The algorithm that is used for lines between begin and end takes three octets as input and writes four characters of output by splitting the input at six-bit intervals into four octets, containing data in the lower six bits only. These octets are converted to characters by adding a value of 0x20 to each octet, so that each octet is in the range 0x20-0x5f, and each octet is assumed to represent a printable character. Each octect is then translated into the corresponding character codes for the codeset in use in the current locale. For exam- ple, the octet 0x41, representing 'A', would be translated to 'A' in the current codeset, such as 0xc1 if the codeset were EBCDIC. Where the bits of two octets are combined, the least significant bits of the first octet are shifted left and combined with the most sig- nificant bits of the second octet shifted right. Thus, the three octets A, B, C are converted into the four octets: 0x20 + (( A >> 2 ) & 0x3F) 0x20 + (((A << 4) ((B >> 4) & 0xF)) & 0x3F) 0x20 + (((B << 2) ((C >> 6) & 0x3)) & 0x3F) 0x20 + (( C ) & 0x3F) These octets are then translated into the local character set. Each encoded line contains a length character, equal to the number of characters to be decoded plus 0x20 translated to the local character set as described above, followed by the encoded characters. The maximum number of octets to be encoded on each line is 45. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWesu | +-----------------------------+-----------------------------+ |Interface Stability |Standard | +-----------------------------+-----------------------------+ SEE ALSO
mail(1), mailx(1), uucp(1C), uux(1C), attributes(5), environ(5), largefile(5), standards(5) NOTES
The size of the encoded file is expanded by 35% (3 bytes become 4, plus control information), causing it to take longer to transmit than the equivalent binary. The user on the remote system who is invoking uudecode (typically uucp) must have write permission on the file specified in the decode_pathname. If you invoke uuencode and then execute uudecode on a file in the same directory, you will overwrite the original file. SunOS 5.10 6 Aug 2003 uuencode(1C)
All times are GMT -4. The time now is 01:52 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy