Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > Perl > Perl Misc > using Mail::Sender to send email with attachment

Reply
Thread Tools

using Mail::Sender to send email with attachment

 
 
eddiekwang@hotmail.com
Guest
Posts: n/a
 
      04-18-2006
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 Removed)', to => '(E-Mail 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();
********************

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to send the email attachment zhao wang Java 2 01-04-2005 07:55 AM
How to send an email with an attachment? yihan Java 3 11-10-2004 03:51 PM
Using MIME::Lite in Windows to send email with a zip attachment James Perl Misc 1 08-04-2004 09:58 PM
cannot send attachment with email The Prophecy Computer Support 4 06-16-2004 03:19 AM
HOWTO: Send an email w/ attachment? Sam ASP .Net 1 01-28-2004 10:34 PM



Advertisments