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

[MacPerl] MIME:: Problems!!!!



Last week I posted a request about sending and receiving mail
attachments and am writing to report some bad news. 

I found the appropriate modules at CPAN and got the script to run easily
on a unix server, but had tremendous problems running on macperl. It
seems the problem is in the MIME::Entity interaction, the SMTP part
works fine.

I think one problem could be that one (or more) of the mods is looking
for a "C" compiler. The MIME::Base64 doc's mention that if you don't
have one , (and I don't think I do!) the Base64.xs file should be
removed before running the Makefile.PL. But then it won't run without
MacPerl SDK (where do I get this?). I also tried editing the code
directly to eliminate the XS and just use perl, but this still didn't
work. 

This script has done some weird things .... be careful!!

1. "Out of Memory" messages
2. Type 2 errors that quit MacPerl
3. Type 10 errors asking for restart
4. TOTAL CRASH ( highly nefarious, I agree!)

Any help would be appreciated!!

Samuel

###
use MIME::Entity;
use Net::SMTP;
###

$host="144.91.193.91";
$smtp= Net::SMTP->new($host, Debug   => 0,);
$sender="test_smtp_mime\@tondacase.com";
$mail="daffners\@mills.edu:daff\@upward-bound.mills.edu:zoe";

###

print "\nSubject=";
$subject=<STDIN>;

print "\nMessage=";
$message=<STDIN>;

###

@m=split(/:/,$mail);

foreach $recip (@m){
    $top = build MIME::Entity Type    =>"multipart/mixed",
            
            From    => "$sender",
            To      => "$recip",
          Subject   => "$subject";

attach $top  Data=>$message;

    # Part #1: a simple text document: "text.txt";

attach $top  Path=>"daffners:Desktop Folder:6.9:";

    # Part #2: a GIF file:
  
attach $top      Path        => "zo1.jpg",
                 Type        => "image/jpg",
                 Encoding    => "base64";

open (OUTFILE,">out5");
 $top->print(\*OUTFILE);
close(OUTFILE);

open (OUTFILE2,"out5");
@send=<OUTFILE2>;
close(OUTFILE2);

$smtp->mail('daff');
    $smtp->to("$recip");
    $smtp->data();
 #  $smtp->datasend("To: $recip\n");     # these are needed when sending
regular SMTP mail, 
 #  $smtp->datasend("Subject: test\n");  # but not in this case, MIME::
seems to make
 #  $smtp->datasend("\n");               # its own appropriate
headers....
    $smtp->datasend(@send);              # just send the array data :)
    $smtp->dataend();

print " Your msg and attached files have been sent to $recip!!!\n";

}

$smtp->quit;
print "files mailed...program over !!!\n";


###end of program

***** Want to unsubscribe from this list?
***** Send mail with body "unsubscribe" to mac-perl-request@iis.ee.ethz.ch