The UNIX and Linux Forums  

Go Back   The UNIX and Linux Forums > OS Specific Forums > HP-UX
Google UNIX.COM


HP-UX HP-UX (Hewlett Packard UniX) is Hewlett-Packard's proprietary implementation of the Unix operating system, based on System V.

More UNIX and Linux Forum Topics You Might Find Helpful
Thread Thread Starter Forum Replies Last Post
Sending email attachments venush UNIX for Dummies Questions & Answers 2 06-05-2008 10:42 PM
Sending multiple attachments deo2k8 Shell Programming and Scripting 1 01-07-2008 10:12 PM
sending attachments via unix Abhishek Ghose UNIX for Advanced & Expert Users 6 09-30-2005 01:49 PM
ksh : using mailx and attachments madmat Shell Programming and Scripting 2 08-01-2005 08:06 PM
sending files as attachments SmartJuniorUnix How do I send email? 9 04-13-2001 04:34 AM

Reply
 
Submit Tools LinkBack Thread Tools Search this Thread Display Modes
  #1  
Old 08-07-2007
Registered User
 

Join Date: Feb 2005
Posts: 5
Exclamation Sending Attachments Through mailx

Dear All,
I'm using HP-UX and we have mailx as the mail client.
I want to send a mail from the OS once I get the count from a table on Oracle. I'm thinking of redirecting the count to a file in Unix and get the output. This output spoolfile has to be sent through mail for reference.
Please let me know how can I attach this spoolfile("Status`date '+%d%m%y%H%M'`.txt") to the mail.

Here is the code sample I'm using:

#!/bin/ksh

#. ./set_mail_details.ksh
ORACLE_HOME="/software/ora/oracle/product/8.1.7/"
export ORACLE_HOME
lp=0
count=`/software/ora/oracle/product/8.1.7/bin/sqlplus -s scott/tiger@ora <<EOP
set term off
set heading off feedback off verify off
SELECT count(1) FROM <Table> ;
exit;
/
EOP`

echo "$count" >> "Status`date '+%d%m%y%H%M'`.txt"
echo 'In script'
subject="Status Mail"
echo '\nsubject'
echo "$subject" | sed 's/~/ /g' | read sub
body_of_email=`cat ./Mail.txt`
echo '\nBody\n\n'
echo '\nMail List'
to_list=<recipient@domain.com>
echo "$to_list"
echo "$body_of_email" | sed 's/~/ /g' | read body
(echo "$body";echo "The Count is:\t";echo "$count";echo "\n"; cat MailFooter.txt )| mailx -s "$sub" -r <sender@domain.com> "$to_list"

if [ $? -eq 0 ]
then
echo "Mail is Sent"
else
echo "Mail is not sent(In script)"
fi
Reply With Quote
Forum Sponsor
  #2  
Old 08-07-2007
Registered User
 

Join Date: May 2007
Posts: 211
Sending a file as attachment through mailx command

Code:
uuencode file_name file_name | mailx -s "Subject of mail" "receive@domain.com"
Reply With Quote
  #3  
Old 08-07-2007
Registered User
 

Join Date: Feb 2005
Posts: 5
hi,
I have even used similar version of the command, but that is also not working....

Please help me.

Regards
RK Veluvali
Reply With Quote
  #4  
Old 08-08-2007
Registered User
 

Join Date: May 2007
Posts: 211
I have worked with uuencode in HP-UX. Give a try by executing the uuencode by issuing the full path.

If not then try to check out from similar threads like Mail with attachment
Reply With Quote
  #5  
Old 08-27-2007
Registered User
 

Join Date: Aug 2007
Posts: 1
Problem attaching more than 1 file in single email, using uuencode and mailx command

Hi,
I'm just debugging some UNIX code which is to be used to send multiple attachments in a single mail.I'm using:

(uuencode $FILE $FILENAME; uuencode $FILE1 $FILENAME1) | mailx -s "$SUBJECT" somebody@some.com

The problem is that, I'm receiving the e-mail with the first file attachment all OK, but the 2nd file as something like :
begin 644 myfile.zip
M4$L#!`H``````*I.)1\]0KO)J5(6`*E2%@`,````1%)5241$,# 0N6DE04$L#
M!`H``````)9C#Q_E,1QY)3D6`"4Y%@`,````1%)5241$14TN03` S8.HL`!X&
M`0`4``*1D6,5'Y%C%1\``````````````````$1254E$1$5-+D$P,P` `<`V[

So, probably, it's printing the encoded file in the mail body for the second attachment.
Can you please help me out with this problem.
A lot of thanks.

Subh
Reply With Quote
Google The UNIX and Linux Forums
Reply

Tags
mailx, mailx attachment

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes




All times are GMT -7. The time now is 04:49 PM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited.
The UNIX and Linux Forums Content Copyright ©1993-2008. All Rights Reserved.Ad Management by RedTyger Visit The Complex Event Processing Blog

Content Relevant URLs by vBSEO 3.2.0