Sponsored Content
Top Forums UNIX for Dummies Questions & Answers Send email with attachment and body : mailx , waiting for input , signal Control D Post 302488082 by curleb on Friday 14th of January 2011 09:10:18 PM
Old 01-14-2011
uuencode is likely waiting for you to give it an output file name...IIRC, uuencode would accept a '.'-character to infer keeping the same name. Otherwise, it will be whatever you intend the attachment to be named. Check this by breaking your "script" down into its components.

But from the outside looking in (and using ksh...), you might consider using your cat to serve up a heredoc (which could be piped into your mailx as is). A good heredoc would include an in-line function call to uuencode. Or, just stream it back to mailx itself:

Code:
	/usr/bin/mailx -s "${SUBJECT}" ${TO} <<-EOF

	Attachment: SiteAdminReport_$(date '+%Y%m%d%H%M').htm file from $(date '+%y%j%H%M') run.

	~< ! uuencode ${report_hfile} SiteAdminReport_$(date '+%Y%m%d%H%M').htm 

	Thank you,

	${USER} 
	SomeKinda Interface - Site Administrator Report User

	~.
	EOF

This User Gave Thanks to curleb For This Post:
 

10 More Discussions You Might Find Interesting

1. Shell Programming and Scripting

How to send attachment to web-based email client using mailx

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

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. Shell Programming and Scripting

how to send an email with some body content and attachment

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

Mailx: How to send a attachment using mailx command

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

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

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

7. Shell Programming and Scripting

The body of the Email -- mailx

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

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

9. Shell Programming and Scripting

Mailx with attachment and message body

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

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
LedgerSMB::Mailer(3pm)					User Contributed Perl Documentation				    LedgerSMB::Mailer(3pm)

NAME
LedgerSMB::Mailer - Mail output for LedgerSMB SYNOPSIS
COPYRIGHT
#==================================================================== # LedgerSMB # Small Medium Business Accounting software # http://www.ledgersmb.org/ # # Copyright (C) 2006 # This work contains copyrighted information from a number of sources # all used with permission. # # This file contains source code included with or based on SQL-Ledger # which # is Copyright Dieter Simader and DWS Systems Inc. 2000-2005 # and licensed under the GNU General Public License version 2 or, at # your option, any later version. For a full list including contact # information of contributors, maintainers, and copyright holders, # see the CONTRIBUTORS file. # # Original Copyright Notice from SQL-Ledger 2.6.17 (before the fork): # Copyright (C) 2002 # # Author: DWS Systems Inc. # Web: http://www.sql-ledger.org # # Contributors: # # Original Author and copyright holder: # Dieter Simader dsmimader@sql-ledger.com #==================================================================== METHODS
LedgerSMB::Mailer->new(...) Create a new Mailer object. If any arguments are passed in, a message that uses them will be automatically prepared but not sent. $mail->prepare_message(to => $to, from => $from, ...) Prepares and encodes base message for sending or adding attachments. Arguments to, from, cc, bcc Address fields for the email. subject The subject for the email. message The message body for the email. contenttype The conttent type for the body of the message, not for any attachments. notify Sets the Disposition-Notification-To header (read receipt request) for the message. This header will only be added if a from address is set. $mail->attach(data => $data, file => $file, filename => $name, strip => $strip) Add an attachment to the prepared message. If $data is specified, use the value of that variable as the attachment value, otherwise attach the file given by $file. If both a file and data are given, the data is attached. filename must be given and is used to name the attachment. $strip is an optional string to remove from the filename send with the attachment. $mail->send Sends a prepared message using the method configured in ledgersmb.conf. perl v5.14.2 2012-03-26 LedgerSMB::Mailer(3pm)
All times are GMT -4. The time now is 10:17 PM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy