![]() |
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.
|
|
google unix.com
|
|||||||
| Forums | Register | Forum Rules | Links | Albums | FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read |
| 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-06-2008 01:42 AM |
| Sending multiple attachments | deo2k8 | Shell Programming and Scripting | 1 | 01-08-2008 01:12 AM |
| sending attachments via unix | Abhishek Ghose | UNIX for Advanced & Expert Users | 6 | 09-30-2005 04:49 PM |
| ksh : using mailx and attachments | madmat | Shell Programming and Scripting | 2 | 08-01-2005 11:06 PM |
| sending files as attachments | SmartJuniorUnix | How do I send email? | 9 | 04-13-2001 07:34 AM |
![]() |
|
|
LinkBack | Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
|
|
||||
|
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 |
|
||||
|
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 |
|
||||
|
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 |
|
||||
|
Sending attachments with mailx on HP-UX
I had a request at work to have a report that runs via cron to mail the output as an attachment, which originally brough me to The UNIX and Linux Forums - Learn UNIX and Linux from Experts (via Google.) After finding that I had already tried all of the suggestions I found here I kept looking and a helpful coworker shared with me the one command line option that made it work.
uuencode filename.txt filename.txt | mailx -m -r fromaddress@domain.com -s "Subject" toaddress@domain.com The -m option (see man mailx) causes mailx to not include mime headers. Adding this single option allowed me to send a file as an attachment instead of having it appear in the body of the message. You can thank Wayne Shen for this hint I'm sharing. ![]() While researching the question about multiple attachments I found the following. If you uuencode each attachment you can have a message body as well as multiple attachments, i. e: uuencode file1.txt file1.txt > file1.uuencoded.txt uuencode file2.txt file2.txt > file2.uuencoded.txt cat MessageBody.txt file1.uuencoded.txt file2.uuencoded.txt | mailx -m -r fromaddress@domain.com -s "Subject" toaddress@domain.com |
|
||||
|
Use send mail.......
This should work....
SUBJ="Send mail from Unix with file attachments" TO=someone@domain_name CC=someoneelse_1@domain_name,someoneelse_2@domain_name ( cat << ! To : ${TO} Subject : ${SUBJ} Cc : ${CC} ! cat << ! HOPE THIS WORKS This sample E-mail message demonstrates how one can attach files when sending messages with the Unix sendmail utility. ! uuencode ${file_1} ${file_1} uuencode ${file_2} ${file_2} uuencode ${file_3} ${file_3} ! ) | sendmail -v ${TO} ${CC} if still it is not working try this mailx : (uuencode a.txt a.txt ; echo "this is body text " )| mailx -m -s a@yahoo.com NOte : while sending attachement s u must use -m option |
![]() |
| Bookmarks |
| Tags |
| mailx, mailx attachment |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|