[Date Prev][Date Next][Thread Prev][Thread Next] [Search] [Date Index] [Thread Index]

Re: [MacPerl] Email attachments and library files



Title: Re: [MacPerl] Email attachments and library files
Hi,

I need some help.

I am trying to accomplish the probably relatively simple task of making a
MacPerl script send an email with an attachment. The attachment will always
be a .pdf file in this particular script.

I am using Net::SMTP to send the actual email message. I searched and
could find no documentation on using Net::SMTP to send an attachment. Is
this possible?

Finally I found an example of using MIME::Entity to send the attachment.
The code looks relatively simple. Then I started running into more
problems.

I don't have MIME::Entity. So I tried downloading it from CPAN. After quit
a bit of frustration I finally found cpan-mac-0.40 which promised to
convert the files so my Mac can read it, and install it for me.

I have tried a number of different versions of MIME from CPAN:
MIME-tools-5.304,  MIME-tools-5.209, MIME-tools-4.124, and
MIME-Lite-2.101.
I believe MIME::Lite actually installed itself correctly, but I am not
sure how to use it to send attachments. Is this possible?

The others keep producing errors such as this when I try to use
cpan-mac-0.40 to install them:
Warning: checksum mismatch, b66, 406a
# Use of uninitialized value.
File 'Rocketship:MacPerl  :lib:IO:File.pm'; Line 181
# Unable to open the data fork of :MIME-tools-4.124:testin:(bunch of
messed up characters).
File 'Rocketship:MacPerl  :site_perl:ExtUtils:MM_MacOS.pm'; Line 1026

After looking up this error on the mailing list archives, I found a
message from Chris Nandor saying to unpack it with Stuffit Expander. So I
did, it unpacked just fine, and then I dragged the resulting folder to
"installme" and got:
Checking if your kit is complete...
Looks good
# Illegal character \012 (carriage return), <FH> chunk 1.
File '(eval 21)'; Line 1
# Can't do :Makefile.PL in Rocketship:Desktop Folder:Perl
tools:MIME-tools-5.209.1
# No Rocketship:Desktop Folder:Perl tools:MIME-tools-5.209.1 package data.
File 'Rocketship:MacPerl  :site_perl:ExtUtils:MM_MacOS.pm'; Line 910

So my questions are:
1) Is there a way besides MIME::Entity to attach a file to an email
message?
2) If not, how do I get it installed on my Mac?

Thanks :)
Frances Schuetz

Dear Frances,

I' ve never installed MIME-tools myself, so I cannot help you a lot with this module. Maybe that you have to change all newline chars in all files from LF (\012) to CR (\015) by hand (see the note in the ReadMe file of cpan-mac)? But I have an answer to your first question.  I found an example regarding mail attachments in one of Randal Schwartz' famous, must-have-read,  Web Techniques columns:

         http://www.stonehenge.com/merlyn/WebTechniques/col46.html

He uses MIME::Lite for sending mails with attachments and even mentiones MacBinary files. Looks as if this could be useful for you.

HTH.

Best regards :-)

--Thomas