E
eddiekwang
Hello,
I am using perl on a Windows XP workstation. I need to use a perl
script to send out an email with a html body and a pdf attachment.
I was able to use the following code to send out an email with html
body successfully, but I can't seem to add the attachment. when I tried
the Attach method, both the html and pdf showed as attachment.
Does anyone have an example on how to do this using Mail::Send?
(I tried MIME::LITE and got an error - "'sendmail' is not recognized as
an internal or external command ...". maybe Windows doesn't support
MIME::LITE? )
Any suggestions will be greatly appreciated.
Eddy,
*******************
use Mail::Sender;
$htmlfile = 'C:\temp\my_perl\weekOne.html'; # Name the file
open IN, $htmlfile or die "Cannot open $htmlfile : $!\n";
$sender = new Mail::Sender{smtp => 'smtp.ucsd.edu'};
$sender->Open({ from => '(e-mail address removed)', to => '(e-mail address removed)',
subject => 'HTML test',
ctype => "text/html",
encoding => "quoted-printable"
}) or die $Mail::Sender::Error,"\n";
while (read IN, $buff, 4096) { $sender->SendEnc($buff) };
close IN;
$sender->Close();
********************
I am using perl on a Windows XP workstation. I need to use a perl
script to send out an email with a html body and a pdf attachment.
I was able to use the following code to send out an email with html
body successfully, but I can't seem to add the attachment. when I tried
the Attach method, both the html and pdf showed as attachment.
Does anyone have an example on how to do this using Mail::Send?
(I tried MIME::LITE and got an error - "'sendmail' is not recognized as
an internal or external command ...". maybe Windows doesn't support
MIME::LITE? )
Any suggestions will be greatly appreciated.
Eddy,
*******************
use Mail::Sender;
$htmlfile = 'C:\temp\my_perl\weekOne.html'; # Name the file
open IN, $htmlfile or die "Cannot open $htmlfile : $!\n";
$sender = new Mail::Sender{smtp => 'smtp.ucsd.edu'};
$sender->Open({ from => '(e-mail address removed)', to => '(e-mail address removed)',
subject => 'HTML test',
ctype => "text/html",
encoding => "quoted-printable"
}) or die $Mail::Sender::Error,"\n";
while (read IN, $buff, 4096) { $sender->SendEnc($buff) };
close IN;
$sender->Close();
********************