develooper Front page | perl.beginners | Postings from January 2002

Win32 / SMTP Attachment Question

Thread Next
From:
Francis Henry
Date:
January 30, 2002 05:47
Subject:
Win32 / SMTP Attachment Question
Message ID:
3C57F970.9FC83A@morganstanley.com
Hi:

I am running ActiveState Perl version 5.6.0 on Windows NT 4.0 box (I
know, I know, but they didn't ask my opinion).  What I'd like to do is
send the MIME file I've created with:

sub EmailFile {
                            print "Sending Excel file to users...\n";

                            my $top = build MIME::Entity Type =>
"multipart/mixed",

-From => "LOAN Alert",

-To => "loan maturity",

-cc => "anyuser",

-Subject => "Maturity Alert";


attach $top Path => $filedate,

Type => "application/xls",

Encoding => "base64",

Disposition => "attachment";
                        }

using Net::SMTP.  I'm a little lost.  I new to Perl but I know this can
be done (right?).

I have tried:

    $smtp->mail($ENV{USER});
    $smtp->to('henryf');
    $smtp->data();
    $smtp->datasend($filedate);
    $smtp->dataend();
    $smtp->quit;
This seems to send the string representing the fully qualified file name
as the message.

Would someone be kind enough to point me to the documentation that would
answer my question?  I've looked at 'perldoc Net::SMTP', but I'd like to
see some more on the data/datasend functionality.

Thank you for reading this,
Francis

Thread Next


nntp.perl.org: Perl Programming lists via nntp and http.
Comments to Ask Bjørn Hansen at ask@perl.org | Group listing | About