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

[MacPerl] Mail::Whatever



Hi,

	I been having some troubles trying to decode how to send some mail using the
Mail:: modules. I've been having one of those times when nothing works, no
matter how hard I try, and everything is just beyond my realm of experience. As
beautiful as Macs are, I find that trying to program on them can cause actual
physical pain from the mental anguish. For example, how the heck do you call
one program from another one? AppleEvents? Brrr! Gimme back my command line.
	Anyways, that's not your problem.
	I want to create my own mailer, because every other mailer creates ugly mail.
So, what better way to do it than with Perl? In fact, I created a beautified
mail mailer for our UNIX server and it works great. But - how to do it on a
Mac?... Java? I've spent DAYS trying to find some kind of info on CGI
programming in Java on a Mac. MondoMail called by MacPerl? I don't know how.
Even after reading Chris Nandor's great article in TPJ, I still don't know how
(I tried, but his examples are so different from what I need to do). And so I'm
going back to what I originally tried (and failed) to do: use pure MacPerl.
	Here's what I've managed from the docs:

#!perl

use Mail::Header;
use Mail::Internet;

$ENV{USER}       = 'webmaster';
$ENV{MAILDOMAIN} = 'ola.bc.ca';
$ENV{NAME}       = 'webmaster';
$ENV{SMTPHOSTS}  = 'paros.ola.bc.ca';
@myText          = ("This is a test.","Only a test.");
$myFrom          = 'joshg@ola.bc.ca';
$myTo            = 'joshg@ola.bc.ca';
$mySubject       = 'ola test 1';

$head = new Mail::Header;
$head->add('From',$myFrom);
$head->add('Reply-To',$myFrom);
$head->add('To',$myTo);
$head->add('Subject',$mySubject);

$int= new Mail::Internet(Header, $head, Body, @myText);
$int->print();

exit(0);

AND here's the output:

# Can't use string ("Header") as a symbol ref while "strict refs" in use.
File 'Boba Fett:Applications:MacPerl f:lib:Mail:Internet.pm'; Line 46

	Digging deep into this OOP code is a major headache. I have no idea what line
46 does, let alone why it's barfing about ("Header") as a symbol reference. ANY
help would be very much appreciated.

-josh
-----------------------------------------------------------------
                       Open Learning Agency
4355 Mathissi Place, Burnaby, B.C. Canada, V5G 4S8 (604) 431-3000


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