Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

attach file using mailx 1

Status
Not open for further replies.

new2me

Technical User
Mar 12, 2004
176
CA
anyone know how I can ATTACH couple of files using mailx?

I know using the following will send a single file as part of the mail. mailx -s attached to.me@thissite.com < file1

Thank-you in advance.
 
A simple thread search pulled up the following:

thread80-543846
 
If you want to include a little message, you can do something like...
[tt]
#!/bin/ksh

export TO=[ignore]someone@somewhere.com[/ignore]
export FILE=myfile.dat

( cat <<-MSG
Hi There,

Please find the attached file ${FILE} as of $(date).

Cheers.
MSG
uuencode ${FILE} ${FILE}
) | mailx -s "${FILE} as of $(date)" ${TO}
[/tt]
You can even have multiple attachments by just adding more [tt]uuencode[/tt] lines, one for each file.

Hope this helps.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top