On Thu, 20 Nov 2008, Matthias Weiser wrote:
> I am following the FAQs and try to send SMTP mail via Log4Perl.
> I first tried this configuration:
>
> log4perl.category = FATAL, Mailer
> log4perl.appender.Mailer = Log::Dispatch::Email::MailSend
> log4perl.appender.Mailer.to = x@z.com
> log4perl.appender.Mailer.from = y@z.com
> log4perl.appender.Mailer.subject = Something's broken!
> log4perl.appender.Mailer.layout = SimpleLayout
> log4perl.appender.Mailer.Server = x.x.x.x
> log4perl.appender.Mailer.smtp = 1
> log4perl.appender.Mailer.buffer=0
Hi Matthias,
it looks good to me, I just verified that it works with my SMTP server.
> This did not work as smtp is a scalar reference in the constructor of
> Mail::Mailer and log4perl seems to call it only with hashes.
Not sure what you're using, but my Mail::Mailer's constructor looks like
$mailer = Mail::Mailer->new($type, @args);
so there's no references, and that's how I think the code in
Log::Dispatch::Email::MailSend uses it as well.
> Then I tried the suggestion of the module desciption for
> Log::Dispatch::Email::MailSend and tried "use Mail::Mailer 'smtp',
> Server => 'foo.example.com';" which did not work either. (Cannot
> locate 'Server' at log4Perl.pl line 1 Warning: something's wrong at
> /opt/ActivePerl-5.8/site/lib/Mail/Mailer.pm line 278).
Hmm, your version of Mail::Mailer seems to be different from the one on
CPAN -- which one are you using?
-- Mike
Mike Schilli
m...@pe...
|