bar10der has asked for the wisdom of the Perl Monks concerning the following question:
Any help will be greatly appreciated. Thanks#!/usr/bin/perl -w use MIME::Lite; #use strict; use warnings; my $mail_host = 'server name'; my $to="email"; my $from="fromServer"; my $subject="Reports"; my $attach = "daily_summary.csv"; my $body = "See attached reports.\n"; ### Create the multipart container my $msg = MIME::Lite->new ( From => $from, To => $to, Subject => $subject, Type =>'multipart/mixed' ) or die "Error creating multipart container: $!\n"; ### Add the text message part $msg->attach ( Type => 'TEXT', Data => $body ) or die "Error adding the text message part: $!\n"; ### Add the file $msg->attach ( Type => 'text/csv', Path => 'csv file path', Filename => $attach, Disposition => 'attachment' ) or die "Error adding $attach : $!\n"; ### Send the Message MIME::Lite->send('smtp', $mail_host, Timeout=>60); $msg->send;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MIME::Lite behaving strange
by jethro (Monsignor) on Apr 01, 2009 at 14:34 UTC | |
by bar10der (Beadle) on Apr 01, 2009 at 15:18 UTC | |
by jethro (Monsignor) on Apr 01, 2009 at 15:38 UTC | |
by bar10der (Beadle) on Apr 02, 2009 at 07:39 UTC | |
by Anonymous Monk on Jul 22, 2015 at 06:03 UTC | |
by Anonymous Monk on Jul 22, 2015 at 06:07 UTC | |
|