Slashdot Mirror


Sending E-mail Attachments From NT Command Line?

Losing my love of PERL asks: "OK, here's the skinny: I've been trying to figure this out for quite a while now, and nothing is working. I need to send a proper e-mail attachment (i.e. something that will show up as a paper clip in Outlook) from an NT command line to be called by a PERL script (or better yet, just sent by the script). I've tried several modules and programs, including Blat, Mail::Sender, Mail::Sendmail, but every time the attachment is just shoved into the body of the e-mail. Does anyone have a solution to my problems?"

5 of 12 comments (clear)

  1. try MIME::LITE by lomion · · Score: 2

    you can try MIME::LITE, it's a perl modukle that is just for that.

    haven't used it under NT so I cannot say if there is are any funkiness or porting that needs to be done with it.

    Check CPAN:
    http:/ /www.perl.com/CPAN-local/modules/by-module/MIME/MI ME-Lite-1.137.readme or
    http://www.perl.com/CPAN-loc al/modules/by-module/MIME/

    --
    this space for rent
  2. Have to use PERL? by acarey · · Score: 2

    Does the script have to use PERL? If not, you could try using MAILTO, a free 10 kb program available from winfiles.com that allows you to send SMTP mail from a commandline. You need an SMTP server available somewhere on your network. Or if Microsoft Exchange is the backend, then I have a VBScript script that can be invoked via Windows Scripting Host to send a piece of mail (plus an attachment). Email me off of the list if you want to get it: alastair@hsnz.co.nz

    --
    -- "I believe the human being and the fish can coexist peacefully." - George W. Bush, 29 September 2000
  3. Mail::Sender by Matts · · Score: 3

    Firstly, Outlook sometimes puts the attachment in the body. That's just how it works. If you don't want it to happen you'll have to specify a MIME type it doesn't recognise, or zip up your file. It will do this with HTML or text attachments. Netscape Messenger does the same thing.

    Having said all that, Mail::Sender works extremely well, even if the code is a bit spaghetti-ish. And does attachments just fine.

    --

    Matt. Want XML + Apache + Stylesheets? Get AxKit.
  4. attachments by radja · · Score: 2

    It's not that hard to put something in an attachment rather then in the body. any attachment is simply included in the body with separators. These separators can easily be built up by hand. dependant on the file, you may have to run uuencode over it though. This approach worked perfectly for me, is platform-independant and also not dependant on any overbloated application.

    //rdj

    --

    No one can understand the truth until he drinks of coffee's frothy goodness.
    --Sheikh Abd-Al-Kadir, 1587
  5. Blat! by spoonyfork · · Score: 2
    I've been using Blat! for one of my projects that requires a win32 command line mailer. Blat! has a very small footprint and lots of options (including attachments). If you don't want to install a whole scripting environment like WSH or Perl this might be a viable option.

    Oh, they provide the source too. Check it:

    http://www.interlog.com/~tcharron/blat. html

    -the spoony fork

    --
    Speak truth to power.