On Sunday 18 September 2005 22:11, A. Khattri wrote:
> On Mon, 19 Sep 2005, Ow Mun Heng wrote:
> > Be that as it may, I'm not Perl person (picked up the book, but haven't
> > really progressed anywhere hehe).
> >
> > But.. when push comes to shove....
>
> Im assuming there is probably a CPAN module that does most of this for you
> - this is why I think Perl might be a better way to go.
>
>
> --
there is...MIME::Entity...used thusly (from a perl program I use to email pdf 
files, but you pass the mim-type on the command line, so it can send any mime 
type):
    my $top = MIME::Entity->build(Type          => "multipart/mixed",
                                  From          => "[EMAIL PROTECTED]",
                                  Bcc           => $address,
                                  Subject       => "Mills Messenger by 
e-Mail");

    $top->attach( Path          => $file_to_send,
                  Type          => $mime_type,
                  Encoding      => "base64");

    my $message = "Attached is your Mills Messenger for this week.  Enjoy!";
    $top->attach(Data=>$message);

    open MAIL, "|/usr/sbin/sendmail.postfix -t -oi -oem" or die "Error on mail 
o
pen is: $!\n";
    $top->print(\*MAIL);
    close MAIL;

-- 
John Jolet
Your On-Demand IT Department
512-762-0729
www.jolet.net
[EMAIL PROTECTED]
-- 
gentoo-user@gentoo.org mailing list

Reply via email to