X-Git-Url: http://wagnertech.de/git?a=blobdiff_plain;ds=sidebyside;f=SL%2FMailer.pm;h=eb94ae3f799dc27571894f4c4457409a4d66bcc5;hb=072caebf05b59b8b74f7f5699d99129834bab616;hp=6536850581a0b611669c39c8e5e697a5b1a799c1;hpb=687f2d9638182ead968d333af325c912d903b675;p=kivitendo-erp.git diff --git a/SL/Mailer.pm b/SL/Mailer.pm index 653685058..eb94ae3f7 100644 --- a/SL/Mailer.pm +++ b/SL/Mailer.pm @@ -17,7 +17,8 @@ # 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; @@ -38,6 +39,11 @@ use strict; my $num_sent = 0; +my %mail_delivery_modules = ( + sendmail => 'SL::Mailer::Sendmail', + smtp => 'SL::Mailer::SMTP', +); + sub new { my ($type, %params) = @_; my $self = { %params }; @@ -54,7 +60,7 @@ sub _create_driver { 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);