Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl-Sensitive Sunglasses
 
PerlMonks  

Re: Sending email attachments

by Limbic~Region (Chancellor)
on Jul 24, 2003 at 22:41 UTC ( [id://277727]=note: print w/replies, xml ) Need Help??


in reply to Sending email attachments

Anonymous Monk,
Out of pure curiosity, does your script do anything other than send the emails that your snippet shows? The reason I ask is because I come from a shell scripting background and still use my command line (KSH) for such tasks:
$ for file in `ls` > do > (echo The file $file is attached;uuencode $file $file) | mailx - +s "$file" email@address.com > done
Now don't get me wrong - I am a Perl fiend. My office has running jokes about my obsession since I am the only wannabe JAPH in the office, but I do not find myself turning to Perl for every task that comes up. I was just wondering if this was a similar situation.

Cheers - L~R

Replies are listed 'Best First'.
Re: Re: Sending email attachments
by spartan (Pilgrim) on Jul 25, 2003 at 23:15 UTC
    Won't that send out a seperate email for each file? Don't get me wrong, your solutiuon is elegant, and simple, but for a large number of files, it could be frustrating for the recipient.

    Very funny Scotty... Now PLEASE beam down my PANTS!
      spartan,
      Yes - but that's what the original snippet does. If you wanted to send them all at once (better hope they are small files or that there are no size restrictions along the way), you would simply do:
      $ (for file in `ls` > do > subject="$subject $file" > uuencode $file $file > done) | mailx -s "$subject attached" email@address.com

      Cheers - L~R

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://277727]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others having a coffee break in the Monastery: (1)
As of 2024-04-18 23:32 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found