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

[MacPerl] scripting eudora within macperl



This may not be elegant, but at least it works.  But if I read @msg from
another file, the applescript breaks: no message ever appears in Eudora.
Suggestions welcome.  (I do want to send messages via Eudora, despite
evident drawbacks.)

-Ken

#! perl -w

@addressee = (address1, address2);
$subject = "test subject";
$ccto = "";
$bccto = "";
@msg = ("this is a test message\n", "and this is the second line\n");
#PROBLEM HERE
$msg = join("", @msg);

foreach $line (@addressee) {
	$to = "$line";
	$from = "kpierce\@mit.edu";

MacPerl::DoAppleScript(<<END_SCRIPT);
tell application "Eudora Pro"
 make message at end of mailbox "out" of mail folder ""
 set field "to" of message 0 to \"$line\"
 set field "from" of message 0 to \"$from\"
 set field "subject" of message 0 to \"$subject\"
 set field "cc" of message 0 to \"$ccto\"
 set field "bcc" of message 0 to \"$bccto\"
 set field "" of message 0 to \"$msg\"
 save message 0 -- saves it in outbox; not queued
end tell
END_SCRIPT
}



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