mail Updated: 11/13/2000 1:30PM (, sending) mailx and send_attachment

Preface and Warning Sometimes you want to send yourself a note that your job completed successfully or you want to send asmall report to yourself or a user. makes sense in this case. Please do not get married to the idea of using mail as a method of report distribution. There are other alternatives for report distribution that will be ready within 6 months to a year. If you want to set up a new job, please contact us at ITCS.

Here is the reason why we say this: Email (on the Internet) was never designed/meant to deliver large attachments. In fact, the largest sendable email message at NU is 10 Megabytes; this means that the largest attachment can only be about 7 Megabytes. It has been said that the Associate Director, ITCS would disable emailing if it got out of control and endangered the campus email machines.

Mailx You can use the mailx(1) command to send out small text messages and we recommend its use for that. (A discussion of how to send text files as attachments is discussed in a later section.) Here is how you send out a file to a recipient using the mailx(1) command

mailx -s "subject" [email protected] < /etc/profile and the syntax for that was:

mailx -s "subject" recipient_email_address < filename

Elm We have seen some folks use the elm(1) command in their shell scripts for their Autosys jobs, but we at ITCS would discourage its use. The mailx(1) command is simpler and has fewer side effects. I have seen some funny output for Autosys jobs that came from the elm command. Better to stay with mailx than elm for mailing messages out. It's simpler.

Sending text attachments Suppose you don't want to see the email headers in your report and you want the report to be sent as a file. We at ITCS have written a script to take care of this for you. It's called send_attachment and its syntax is:

Here's how to send out messages as attachments:

/opt/local/bin/send_attachment \ -r [email protected] \ -a /etc/profile \ -s "a copy of /etc/profile for you"

(The entire command fits all on one line; I've just used line-continuation character '\'). Here's the syntax for it:

/opt/local/bin/send_attachment -r email address of recipient -a filename of attachment -s message subject (optional, otherwise it defaults to date and filename)

If you want to send more than one attachment at a time or if you want to send binary attachments, this will not work. Please see us to get send_attachment extended.