The UNIX and Linux Forums  
Hello and Welcome from United States to the UNIX and Linux Forums! Thank You for Visiting and Joining Our Global Community.

Go Back   The UNIX and Linux Forums > Operating Systems > 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-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

Closed Thread
English Japanese Spanish French German Portuguese Italian Dutch Swedish Russian Norwegian Hungarian Hebrew Danish Bulgarian Greek Powered by Powered by Google
 
LinkBack Thread Tools Search this Thread Rate Thread Display Modes
  #1 (permalink)  
Old 01-21-2009
fcp fcp is offline
Registered User
  
 

Join Date: Jan 2009
Location: Birmingham, AL
Posts: 1
Using sendmail with MIME

I think a more general answer is just to go ahead and use MIME. (Note: the mailx -m option mentioned earlier is not universal; for example, AIX doesn't have it).

Here's what I cobbled together out of parts of two (individually incorrect) answers on unix.com. Once you have the MIME skeleton in place, it's trivial to add body text,
more attachments, etc. Obviously, you change the encoding and use uuencode if you're sending a binary.

I hope none of the micro-changes I made to hide site identification, etc., break this thing, for indeed, it worketh :-)


#!/usr/bin/ksh
# Force environment for running under cron:
. $HOME/.profile
cd $HOME/script
rm -f cqsumm.csv 2>/dev/null
OUTFILE=$(date +%Y%m%d)cqsumm.csv
ADDRS=this@there.com,that@there.com,me@mydomain
sqlplus f_maint/f_maint @cqsumm
mv cqsumm.csv ${OUTFILE}
# It's a lot more convenient for the customer to open an attachment,
# so I replaced this next line with the sendmail/MIME code
# that comes after:
#cat ${OUTFILE} | mail -s"-secure- Coding queue summary" ${ADDRS}
# The -secure- in the Subject triggers email encryption through the Zix gateway. (very site-specific, that)
# This is required by HIPAA.
cat > foo << EOF
Subject: -secure- Coding queue summary
To: ${ADDRS}
MIME-Version: 1.0
Content-Type: Multipart/Mixed; boundary="MIME_BOUNDARY"
--MIME_BOUNDARY
Content-Type: text/plain; charset=us-ascii; NAME=${OUTFILE};
Content-transfer-encoding: 7bit
$(cat ${OUTFILE})
--MIME_BOUNDARY--
EOF
cat foo | /usr/sbin/sendmail -oi -t -f fnsw@myserver.mydomain ${ADDRS}
Closed Thread

Bookmarks

Tags
mailx, mailx attachment

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are On




All times are GMT -4. The time now is 07:14 AM.


Powered by: vBulletin, Copyright ©2000 - 2006, Jelsoft Enterprises Limited. Language Translations Powered by .
vBCredits v1.4 Copyright ©2007 - 2008, PixelFX Studios
The UNIX and Linux Forums Content Copyright ©1993-2009. All Rights Reserved.Ad Management by RedTyger

Content Relevant URLs by vBSEO 3.2.0