[ale] Re: Script to send email with attachments

Chuck Huber chuck at cehuber.org
Mon Sep 24 14:18:31 EDT 2007


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

ale-request at ale.org wrote:
> Message: 1
> Date: Sun, 23 Sep 2007 12:43:59 -0400
> From: Thompson Freeman <tfreeman at intel.digichem.net>
> Subject: [ale] Script to send email with attachments
...
> The task is to send a number (close to 80) jpg pictures to  
> a yahoo mail account by email.

mailx works well for attachments.  Here's a script I use on a remote
system to send a backup log via email attachment:

	# echo "body text" | mailx -s "`hostname` backup succeeded" -a
ftpbackup.log.gz -r "${MAILFROM}" "${MAILTO}"

The -s set the subject, -r sets the mail originator, and -a attaches a
file.  The last argument is the intended recipient.

The mailx home page is at: http://heirloom.sourceforge.net/mailx.html

Of course it wouldn't hurt to compress each file individually anyway.

Hope this helps,
    - Chuck

- --
Chuck Huber
Duke Pro, Inc.
Office: 828-684-6022
Cell: 828-778-3776
Home: 828-683-7324
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFG9/9piR3HaLbYCa4RAqBfAKCQMmVNasGhiBQxFmNeElcUsFa2mgCdHBhN
5n26HCEtCaCegjk/Dta7neA=
=kEX+
-----END PGP SIGNATURE-----



More information about the Ale mailing list