# GNU General Public License for more details.
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
-# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
+# MA 02110-1335, USA.
#======================================================================
package Mailer;
my $num_sent = 0;
+my %mail_delivery_modules = (
+ sendmail => 'SL::Mailer::Sendmail',
+ smtp => 'SL::Mailer::SMTP',
+);
+
sub new {
my ($type, %params) = @_;
my $self = { %params };
myconfig => \%::myconfig,
);
- my $module = ($::lx_office_conf{mail_delivery}->{method} || 'smtp') ne 'smtp' ? 'SL::Mailer::Sendmail' : 'SL::Mailer::SMTP';
+ my $module = $mail_delivery_modules{ $::lx_office_conf{mail_delivery}->{method} };
eval "require $module" or return undef;
return $module->new(%params);