breezesunshine
Technical User
Hi:
I apologize if this is a stupid question. I am new to Perl. Thanks in advance for your help!
I can't figure out why I keep getting this eror when running the code below:
"Can't locate object method "send_by_SMTP" via package "MIME::Lite" at C:/Perl/li
b/MIME/Lite.pm line 2451."
The MITE::Lite module is installed successfully (I use PPM and ActivePerl on windows).
Here is the code:
--------------------------------
use MIME::Lite;
use NET::SMTP;
### Create the multipart "container":
$msg = MIME::Lite->new(
From =>'breezesunshine@yahoo.com',
To =>'lan_bo@hotmail.com',
Subject =>'A message with 2 parts...',
Type =>'multipart/mixed'
);
### Add the text message part:
### (Note that "attach" has same arguments as "new"):
$msg->attach(Type =>'TEXT',
Data =>"Here's the GIF file you wanted"
);
### Add the image part:
$msg->attach(Type =>'image/jpg',
Path =>'d:/test.jpg',
Filename =>'test.jpg',
Disposition => 'attachment'
);
### Format as a string:
$str = $msg->as_string;
### Write just the header:
$msg->print_header(\*STDOUT);
### Send the message;
$msg->send("SMTP");
I apologize if this is a stupid question. I am new to Perl. Thanks in advance for your help!
I can't figure out why I keep getting this eror when running the code below:
"Can't locate object method "send_by_SMTP" via package "MIME::Lite" at C:/Perl/li
b/MIME/Lite.pm line 2451."
The MITE::Lite module is installed successfully (I use PPM and ActivePerl on windows).
Here is the code:
--------------------------------
use MIME::Lite;
use NET::SMTP;
### Create the multipart "container":
$msg = MIME::Lite->new(
From =>'breezesunshine@yahoo.com',
To =>'lan_bo@hotmail.com',
Subject =>'A message with 2 parts...',
Type =>'multipart/mixed'
);
### Add the text message part:
### (Note that "attach" has same arguments as "new"):
$msg->attach(Type =>'TEXT',
Data =>"Here's the GIF file you wanted"
);
### Add the image part:
$msg->attach(Type =>'image/jpg',
Path =>'d:/test.jpg',
Filename =>'test.jpg',
Disposition => 'attachment'
);
### Format as a string:
$str = $msg->as_string;
### Write just the header:
$msg->print_header(\*STDOUT);
### Send the message;
$msg->send("SMTP");