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.
|