in reply to Re^3: How do I get Windmail to send an email attachment
in thread How do I get Windmail to send an email attachment

Err, there's nothing in the perl error log, and I don't have access to any other logs!
Never knowingly obfuscated
  • Comment on Re^4: How do I get Windmail to send an email attachment

Replies are listed 'Best First'.
Re^5: How do I get Windmail to send an email attachment
by Corion (Patriarch) on Apr 04, 2008 at 14:38 UTC

    Does -f $Form{attachment} return a true value?

    Also, you are aware that your form may be used to send spam, not only to your company but also to any other address, by (for example) setting the subject to "Hi!\nTo: somewhere@example.com"?

      This is what $Form{attachment} outputs: 'T:\Perlcgi\Brief\admin.htm' And yes I am aware. It's not a public webserver, so I'm not worried about that!

      Ah, windmail logs - OK I'll ask the techies here to look in them for me!!
      Never knowingly obfuscated

        You haven't told us whether a file actually exists at the location that $Form{attachment} outputs. The -f test checks for that. As T: sounds like a (remote) network drive, it could also be that the webserver user (and thus, likely the Windmail user) don't have access to that network resource. A second test from within Perl could confirm that, as could obtaining the Windmail logs.

        Of course, you can still simply copy MIME::Lite into your script, no matter how much reluctance you show.

Re^5: How do I get Windmail to send an email attachment
by Anonymous Monk on Apr 04, 2008 at 14:36 UTC
    You could check $?, but without access to windmail logs, you're poking in the dark
      I have now got to the bottom of the problem. The code was OK.
      The issue was that the document that I wanted to attach to the email had to be on the same server as I was running the script on. I can live with that, but it would be more user friendly if it could be on any server! Any suggestions as to how that would be achieved?
      Never knowingly obfuscated

        I already told you. This is a user permissions issue. Likely the user your webserver (and thus your script) runs as has no access to network resources. This is usually a good thing.

        Yes, upload file first to server, then attach