01-14-2011
Send email with attachment and body : mailx , waiting for input , signal Control D
Hi,
I am trying to send email with attacment and body using "mailx"
(cat body.txt; uuencode attach.txt) | mailx -s "Attachment"
abc@xyz.com
When i type this command, the shell is still waiting for me to enter something in standard input and press control D before it sends a mail and completes the command line.
Can you please let me know how can I skip this since I want to send the above mail in automated shell script and user will not be there to press control D
Pls see attachmet. Shell I am using is CShell.
This User Gave Thanks to aliaszero For This Post:
10 More Discussions You Might Find Interesting
1. Shell Programming and Scripting
hi,
i am trying to send mail with attachment to web-based email client like gmail.com using mailx. the problem is it is displayed in content rather than as attachment.
the code i am using is as follows,
uuencode test1.txt test1.txt | mailx -s "test only" aaaa@gmail.com
does anyone... (1 Reply)
Discussion started by: randomcz1
1 Replies
2. UNIX for Dummies Questions & Answers
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. Shell Programming and Scripting
hi
plz help me in sending a mail with some data in body and an attachment as some txt file.
currently i am able to send mail with some body content, i need an example how to send the same along with attachment.
thanks in advance
-bali (2 Replies)
Discussion started by: balireddy_77
2 Replies
4. Shell Programming and Scripting
Hi All,
Can anyone please provide the command for sending an mail with attachment using mailx command.
Thanks in Advance :)
Regards,
Siram. (3 Replies)
Discussion started by: Sriram.Vedula53
3 Replies
5. Shell Programming and Scripting
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
6. Shell Programming and Scripting
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
7. Shell Programming and Scripting
Hi,
I am using mailx command to send an email and i took the body of the email from a file,
mailx -r gtt.org -s "Status Report " ss@org.com < $ProcessStatisticsFile
but now i want to declare the body of the email in the command itself.
I have tried with the following command but... (4 Replies)
Discussion started by: chinnu01
4 Replies
8. UNIX for Dummies Questions & Answers
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
9. Shell Programming and Scripting
i have to attach the 'body in the email' along with attachment below code is throwing errors, how can i do it ?
here body file contains message, it should display in email, please help
i am using HP-UX
(cat body ;) (uuencode attch1 attch1 ;) | mailx -m -s "testing" "abc@gmail.com"
... (4 Replies)
Discussion started by: only4satish
4 Replies
10. Red Hat
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
LEARN ABOUT OSF1
uuencode
uuencode(1) General Commands Manual uuencode(1)
NAME
uuencode, uudecode - Encodes or decodes a binary file
SYNOPSIS
uuencode [file] remotefile
uudecode [file...]
STANDARDS
Interfaces documented on this reference page conform to industry standards as follows:
uudecode: XCU5.0
uuencode: XCU5.0
Refer to the standards(5) reference page for more information about industry standards and associated tags.
DESCRIPTION
The uuencode and uudecode commands are used to send a binary file via uucp or other mail. This combination can be used over indirect mail
links even when uusend is not available.
The uuencode command takes the named file (default standard input) and produces an encoded version on the standard output. The encoding
uses only printing ASCII characters, and includes the mode of the file and the name for re-creation on the remote system, specified by
remotefile.
The uudecode command reads an encoded file, strips off any leading and trailing lines added by mailers, and recreates the original file
with the specified mode and name. Filter the encode through the uudecode program. Filtering the file causes the original file to be auto-
matically recreated. This is possible on the uucp network by using sendmail or by making rmail be a link to mailx. In each case, an alias
must be created in a master file to get the automatic invocation of uudecode.
If neither of the preceding facilities is available on a user's system, uudecode can be applied to the file manually by editing the file
with any text editor, removing the trailing and leading lines, and changing the mode or remote system name. The encoded file is an ordinary
text file.
EXAMPLES
In the following example, the ex1 file is encoded; the output is also redirected to the ex1.out file: prompt> uuencode ex1 ex1.en > ex1.out
If the source ex1 file is as follows:
This example shows how to encode a file using uuencode and how to decode a file using uudecode.
The encoded ex1.out file would be as follows:
begin 644 ex1.en M5&AI<R!E>&%M<&QE('-H;W=S"G1H92!H;W<@=&@96YC;V1E"F$@9FEL92!U
M<VEN9PIU=65N8V]D90IA;F0@:&]W('1O"F1E8V]D92!A(&9I;&4*=7-I;F<@ *=75D96-O9&4N"F]D ` end In the following example, the ex1.out file is
decoded: prompt> uudecode ex1.out
In this example, the uudecode command decodes the file and puts the output in ex1.en. To package up a source tree using tar, com-
press it, uuencode it, and mail it to a user on another system, enter: tar cf - src_tree | compress | uuencode src_tree.tar.Z |
mail sys1!sys2!user1
(Enter the command entirely on one line, not on two lines as shown above.)
When uudecode is run on the target system, the src_tree.tar.Z file is created; it may then be uncompressed and dearchived with tar.
SEE ALSO
Commands: ct(1), cu(1), mailx(1), Mail(1), rmail(1), sendmail(8), tip(1), uucico(8), uucleanup(8), uucp(1), uulog(1), uuname(1),
uupick(1), uusched(8), uusend(1), uustat(1), uuto(1), uux(1)
Standards: standards(5)
uuencode(1)