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?"

12 comments

  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
    1. Re:Have to use PERL? by acarey · · Score: 1

      Actually, it doesn't matter if you use PERL or not. Both those things I mentioned above could be invoked from a PERL script without difficulty...

      --
      -- "I believe the human being and the fish can coexist peacefully." - George W. Bush, 29 September 2000
    2. Re:Have to use PERL? by tetrode · · Score: 1

      I have used mailto for quite some time in the past, and it has never caused me any problems. Recommended!

  3. Now that you've grown up.... by duplicate-nickname · · Score: 1

    its time to use a real scripting language called VB (script, that is). The method you want to call is CDONT.NewMail. Search the KB for details on how it works.

    --

    ÕÕ

    1. Re:Now that you've grown up.... by rahuljain · · Score: 1

      wow, u really helped

  4. Mpack / Munpack by bilgebag · · Score: 1

    Grab a copy of mpack from ftp://ftp.andrew.cmu.edu/pub/mpack/

  5. 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.
  6. 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
  7. VBscript: the virus writer's #1 choice. by Wakko+Warner · · Score: 1
    I guess lots of people need a real scripting language...

    50% of viruses/trojans are written in VBscript now.

    - A.P.
    --


    "One World, one Web, one Program" - Microsoft promotional ad

    --
    "Remember when the U.S. had a drug problem, and then we declared a War On Drugs, and now you can't buy drugs anymore?"
  8. Several tools here.. by stevey · · Score: 1

    You could try looking at the following site:

    http://www.gnu software.com/ilink/ilink.cgi?Category=E-mail%3ASen ding

    Steve
  9. 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.