On Sun, 25 Mar 2001, Paul J. Schinder wrote:
> >Hmmm...I thought I had it, but not quite. For some
> >reason, my Perl script is outputting to the screen,
> >not my mailwrapper. Are there any limitations on what
> >you can send to the mailwrapper? My program is below:
> >
> >#!/usr/bin/perl
> >
> >$fileout = system("/bin/cat
> >/home/www/schnarff/images/chili.jpg |
> >/usr/bin/uuencode /home/www/schnarff/chili.jpg");
> >$bound = "---bound";
> >
> >open (MAIL, "|/usr/bin/sendmail -t");
> >print MAIL "To: alexlefevre\@yahoo.com\n";
> >print MAIL "Mime-Version: 1.0\n";
> >print MAIL "Content-Type: multipart/mixed;
> >boundary=\"$bound\"; charset=\"iso-8859-1\"\n";
> >print MAIL "$bound\n";
> >print MAIL "Content-Type: image/jpg;
> >name=\"chili.jpg\"\n";
> >print MAIL "Content-Disposition: attachment;
> >filename=\"chili.jpg\"";
> >print MAIL "Content-Transfer-Encoding: uuencode";
> >print MAIL "$fileout";
> >close MAIL;
>
> This may be a little late, but why don't you simply use one of the
> many Perl modules that deal with MIME and know how to do it right,
> for example, MIME::Lite?  Go to <http://search.cpan.org/>.

Would the above solution (and the equiv. using MIME::Lite apply to
qmail-inject as well?  I'm trying to send attachments from a perl
script, too.

thanks,
todd


Reply via email to