in reply to Re: Log4Perl to send mail via SMTP
in thread Log4Perl to send mail via SMTP

I think that the main problem is that Log4Perl can only call the constructor with key-value pairs, unfortunately Mail:Mailer uses smtp as a scalar parameter.
The documentation mentions the following:
Since Mail::Send is a subclass of Mail::Mailer, you can change how mail is sent from this module by simply useing Mail::Mailer in your code before mail is sent. For example, to send mail via smtp, you could do:
use Mail::Mailer 'smtp', Server => 'foo.example.com';
I do not understand this part of the docu. Could one explaint it to me?

Replies are listed 'Best First'.
Re^3: Log4Perl to send mail via SMTP
by Anonymous Monk on Nov 21, 2008 at 02:57 UTC
    #!/usr/bin/perl ... this is your code, to it you add the following use Mail::Mailer 'smtp', Server => 'foo.example.com';
      I tried this and received:
      Cannot locate 'Server' at log4Perl.pl line 1
      Warning: something's wrong at /opt/ActivePerl-5.8/site/lib/Mail/Mailer.pm line 278.
      Broken Pipe