Zitoune has asked for the wisdom of the Perl Monks concerning the following question:

Can you give me short exemple of sending an e-mail with attachement ( of a zip file ) . Thx

Replies are listed 'Best First'.
Re: Example of MIME::Lite
by Ovid (Cardinal) on Jan 27, 2003 at 20:50 UTC

    Munged from the MIME::Lite documentation:

    # Create the multipart "container": $msg = MIME::Lite->new( From => 'me@myhost.com', To => 'you@yourhost.com', Cc => 'some@other.com, some@more.com', Subject => 'A message with 2 parts...', Type => 'multipart/mixed' ); # Add the message body: $msg->attach( Type => 'TEXT', Data => 'Here's the ZIP file you wanted' ); # Add the zip file: $msg->attach( Type => 'application/zip', Path => '/path/to/some.zip', Filename => 'here_you_go.zip', Disposition => 'attachment' );

    Cheers,
    Ovid

    New address of my CGI Course.
    Silence is Evil (feel free to copy and distribute widely - note copyright text)

Re: Exemple of MIME::Lite
by iguanodon (Priest) on Jan 27, 2003 at 21:14 UTC
    On Windows you probably need to do this.

Re: Exemple of MIME::Lite
by Zitoune (Beadle) on Jan 27, 2003 at 20:20 UTC
    i forget to say , i'm under Windows 2000