At 5:11 PM -0400 10/24/10, Mark wrote:
Thank you, Brendon, for taking a look at the script. I'd like to
narrow down the problem so I can finish some working version of this
thing.
I have logic that gets the job of restoring the e-mail done, albeit
using regex in a brute force kind of way rather than parsing the
message elegantly with modules. To get a minimally working, if ugly,
script I just have to e-mail myself the resulting string ('$line'),
which contains the entire multipart MIME message as raw text,
attachments included. After looking at the online Quickstart web
page for Email::Sender (the hyperlink to the more complete manual
goes nowhere), this is what I wrote:
my $recipient = 'Mark Vecchio <mvecc...@mcc.commnet.edu>';
Email::Sender::Simple->send($line, { to => $recipient });
It doesn't work, I hope for reasons that are obvious to some of you
out there. The script does run without throwing any errors in the
Terminal I'm testing it in, but no e-mail gets sent.Toward the top
of the script I've included the lines:
use Email::Sender::Simple qw(sendmail);
use Email::Simple;
use Email::Simple::Creator;
I have no idea where to go from here. I want to e-mail the string
'$line' with all its headers -- i.e. From:, To:, Cc:, and Subject:
-- intact. The To: and Cc: headers will often contain addresses
other than my own, and I don't want to send the e-mail to anyone
else but me. Anyone who can give me a snippet of code to jump start
me in this final phase will become a god in my pantheon.
Have you looked at the documentation for Email::Sender::Simple? The
CPAN page for Email::Sender::Simple refers you to here:
<http://search.cpan.org/~rjbs/Email-Sender-0.102370/lib/Email/Sender/Manual/QuickStart.pm>
Following the sample code on that page will lead you to the following
(untested):
my $email = Email::Simple->create(
header => [ To => 'mvecc...@mcc.commnet.edu' ],
body => $line
);
sendmail($email);
Try that instead. Note that sendmail returns a true value on success
or dies on failure.
--
To unsubscribe, e-mail: beginners-unsubscr...@perl.org
For additional commands, e-mail: beginners-h...@perl.org
http://learn.perl.org/