in reply to Mail::Mailer and Thunderbird
You'll find that you get more out of these forums by giving smaller examples of working code and building up from there. This one is simply hard on the eyes and does not avail itself of the use strict; and use warnings; pragmas (pragmata?), which can make the gurus grumpy, as it inhibits their ability to divine what's going on with your situation. I stripped this down to bare bones just to see what I'd get:
$ perl mail1.pl No real MTA found, using 'testfile' at /usr/local/share/perl/5.14.2/Ma +il/Mailer.pm line 108. we arrived here mailer= Mail::Mailer::testfile=GLOB(0x91baf7c) Reminder= Feed Dino be +fore you go to the quarry. $
I don't know what an MTA is, but I'd imagine that the complaint centers around the e-mails being made up. I did, however, single-quote them, so that the @ sign wouldn't be interpolated, as happens with double-quoting.
use strict; use warnings; my $Reminder = "Feed Dino before you go to the quarry."; mail_reminder(); sub mail_reminder{ use Mail::Mailer; use strict; my $New_Reminder="Reminder"; my $From_address='fred@192.168.1.171'; my $To_address='barney@192.168.1.171'; my $mailer = Mail::Mailer->new(); $mailer->open({ From =>$From_address, To =>$To_address, Subject =>$New_Reminder, }); print $mailer $Reminder; print "we arrived here\n"; print "mailer= ",$mailer," Reminder= ",$Reminder,"\n"; $mailer->close() or die "Can't send: $!\n"; }
Mail::Mailer keeps your abortive attempts in a file for you:
$ cat mailer.testfile === test 1 Wed Apr 22 12:16:00 2015 from: twain@twain-desktop to: barney@192.168.1.171 Subject: Reminder To: barney@192.168.1.171 From: fred@192.168.1.171 Feed Dino before you go to the quarry.$
Ultimately, I decided that this is not how I communicate in this day and age. Of the many things perl does, I don't want it to be an e-mail client when thunderbird, facebook, and cell phone messaging are the alternative.
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: Mail::Mailer and Thunderbird
by afoken (Chancellor) on Apr 22, 2015 at 21:07 UTC |