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

[MacPerl] Mailer....



The following code mostly comes from the original documentation, and it
works!!!

I don't use the Internet Config at all, and still no problems, though I
had used the older macSMTP.pl (with macchat.pl etc.) and this worked
too. I imagine the newer version (Net::SMTP) has some advantages, though
I couldn't say exactly what they are :)

One thing I experienced problems with was in using it as a CGI...at
first I had set up the mailer as a subroutine, which would close the
SMTP connection after sending each mail. SO I had it open, send ALL the
messages, and then close, which works fine. The debug feature really
helps.

My further questions would be:

1. How can I send attachments (text is easy, but what about others???)

2. How can I get mac perl to separate the attached file correctly?

3. Are there any reliable (mac) mail servers that accept AppleEvents,
ie=> could be macperl scriptable?

Thanks,

Samuel

#######

use Net::SMTP;
$host="144.91.193.91";
$smtp= Net::SMTP->new($host, Debug   => 1,) or die "Unable to open the
connection";

 print $smtp->domain,"\n";

#######

$mail="daffners\@mills.edu:postmaster\@upward-bound.mills.edu:daff";
@m=split(/:/,$mail);

foreach $recip (@m){

 $smtp->mail('daff');
    $smtp->to($recip);
    $smtp->data();
    $smtp->datasend("To: $recip\n");
    $smtp->datasend("Subject: test\n");
    $smtp->datasend("\n");
    $smtp->datasend("A simple test message\n");
    $smtp->dataend();
}

$smtp->quit;

#### end of my humble bumble !!! #####

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