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

[MacPerl] Emailer Glue



Okay, thanks to Chris for setting me straight, and to Enrique for his 
suggestions (only slighlty off the mark, and hence still helpful).

Although the "checking" and "sending" booleans are optional, leaving them 
off only seems to work if Emailer is already running, AND the PPP 
connection is already live.  Since neither of these conditions are likely 
to be the case all the time, I've left them in.

Connecting to a "Service":
--------------------------
#!perl -w
use strict;
use Mac::Glue;

my $obj = new Mac::Glue 'Claris_Emailer_1_1v3';
$obj->connect_to("Internet", checking => 1, sending => 1);

The service name needs to be quoted.  This especially make sense with 
"America Online" (needs the space).

Connecting to all "Accounts":
-----------------------------
#!perl -w
use strict;
use Mac::Glue;
use vars qw($obj @raw_accounts);

$obj = new Mac::Glue 'Claris_Emailer_1_1v3';
@raw_accounts = $obj->get_accounts();

foreach (@raw_accounts) {
    $obj->connect_to("$_", checking => 1, sending => 1);
}

Again the account names need quotes.  Should grab all *enabled* accounts 
for all services.  Accounts can be disabled within Emailer, and won't be 
counted by "get accounts".  Essentially, because I only have the 
"Internet" accounts enabled (I have an AOL account that I don't actually 
use, which I find the configuration info is still in Emailer (but the 
"connect to this service" checkbox is unchecked)), these two scripts work 
identically.  I prefer the first one.

All the Apple Events in Emailer were changed with Version 2.0, and 
Emailer is orphaned, but this gets me up and working.

--B



# Brian McNett                                      Fungal Parataxonomy
# Webmaster, Staff Writer               Mycology Information (Mycoinfo)
#                              **The World's First Mycology E-Journal**   
# <mailto:webmaster@mycoinfo.com>            <http://www.mycoinfo.com/>
# First they ignore you. Then they laugh at you. Then they fight you.
# Then you win.                                     --Mohandas Gandhi


# ===== Want to unsubscribe from this list?
# ===== Send mail with body "unsubscribe" to macperl-request@macperl.org