Current Issue


Table of contents

CD-ROM

Sys Admin and The Perl Journal CD-ROM version 12.0

Version 12.0 delivers every issue of Sys Admin from 1992 through 2006 and every
issue of The Perl Journal from 1996-2002 in one convenient CD-ROM!

Order now!

Sys Admin Magazine > Archives > 2001 > April 2001

Questions and Answers

Jim McKinstry and Amy Rich

Q: I would like to be able to automate the creation of a mail message (on Solaris 2.6) that includes an attachment and then send that message onto its destination addresses. However, it appears that, at least with dtmail and pine, this cannot be done. For instance, with dtmail:

# dtmail -a file_to_attach -T destination_addresses

starts up the application and waits for user intervention to press "send". (This also appears to be the case with Microsoft's Outlook.) Is there a way around this issue?

A: If you want to send an attachment without user intervention, you need to use a mailer that supports command-line batching mode and does not drop the user into an interactive editor. You have several options described on the "Sending email with attachments on UNIX systems" page:

http://www3.primushost.com/~kylet/unix-att.html

I think the best of these options is either installing mutt:

http://www.mutt.org/

or MetaMail:

ftp://thumper.bellcore.com/pub/nsb/

mutt can be invoked from the command line as follows:

mutt -s "This is a picture." -a picture.gif recipient@address.com < /dev/null

Syntax with MetaMail would be:

metasend -b -t recipient@address.com -s "This is a picture." -m image/gif -f picture.gif

These commands send picture.gif as a MIME attachment to recipient@address.com with the subject This is a picture. The -b flag in metasend tells it that you want to complete this in batch mode, without user intervention.




MarketPlace

Build IT Knowledge with Current & Trusted Content
Helps Employees Develop & Hone New Technical Programming Skills. Sign Up & Get Full Access.

Workflow Enabled Help Desk & IT Service Management
Automate service desk activities and integrate processes across IT. Learn more here.

Flowcharts from C/C++ code -- Free trial download
Understand C/C++ code in less time. A new team member ? Inherited legacy code ? Get up to speed faster with Crystal Flow for C/C++. Code-formatting improves readability. Flowcharts are integrated with code browser. Export flowcharts to Visio.

Discover WinDev 11 RAD
and develop 10 times faster ! ALM, IDE, .Net, PDF, 5GL, Database, 64-bit, etc. Free Express version

Wanna see your ad here?