[San-Diego-pm] Mail::Sender

Joel Fentin joel at fentin.com
Sat May 12 10:31:26 PDT 2007


http://fentin.com/cgi-bin/Sending3.pl
http://fentin.com/cgi-bin/Sending4.pl

I'm looking for a way of emailing with attachments. Since Mail::Sender 
is already installed in my account, this where I started. I've been 
running lots of variations of the below. They run to the end without 
errors. But they don't send any emails.

The attached files. are in the same directory with the programs.

I'm stuck. Again, what does it want?

===================
#!/usr/bin/perl -w
#Sending3.pl
BEGIN{use CGI::Carp qw(carpout fatalsToBrowser);carpout(\*STDOUT);$|=1;} 
#Don't buffer err msg
use strict;
use Mail::Sender;

my $sender = new Mail::Sender({
smtp => 'smtp.nethere.net',
from => 'avocado at nethere.com',
}) or die "Error in mailing : $Mail::Sender::Error\n";

$sender->OpenMultipart({
     to => 'joel at fentin.com',
     subject => 'Testing 3',
});

$sender->Body;
$sender->SendLineEnc( 'This is a send attachment test.' );
$sender->SendFile({
     description => 'Raw Data File',
     encoding => '7BIT',
     file => 'IRF510.pdf',
});
$sender->Close;

die 'done';
====================
#!/usr/bin/perl -w
#Sending4.pl
BEGIN{use CGI::Carp qw(carpout fatalsToBrowser);carpout(\*STDOUT);$|=1;} 
#Don't buffer err msg
use strict;
use Mail::Sender;

#This is a way of sending an attachment in email.
my $sender = new Mail::Sender({
     from => 'avocado at nethere.com',
});

$sender->OpenMultipart({to => 'joel at fentin.com',
                        subject => 'Testing 4'});
$sender->Body;
$sender->SendEnc('xxx');

$sender->Attach(
{description => 'Perl module Mail::Sender.pm',
  ctype => 'application/x-zip-encoded',
  encoding => 'Base64',
  disposition => 'attachment; filename="Convert.zip"; type="ZIP archive"',
  file => 'Convert.zip'
});

$sender->Close;
die 'done';


-- 
Joel Fentin       tel: 760-749-8863    FAX: 760-749-8864
Email:            http://fentin.com/me/ContactMe.html
Biz Website:      http://fentin.com
Personal Website: http://fentin.com/me


More information about the San-Diego-pm mailing list