![]() |
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 |
|
|
|
||||
|
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} |
![]() |
| Bookmarks |
| Tags |
| mailx, mailx attachment |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|