+ $num_sent++;
+ my $boundary = time() . "-$$-${num_sent}";
+ $boundary = "LxOffice-$self->{version}-$boundary";
+ my $domain = $self->recode($self->{from});
+ $domain =~ s/(.*?\@|>)//g;
+ my $msgid = "$boundary\@$domain";
+
+ my $form = $main::form;
+ my $myconfig = \%main::myconfig;
+
+ my $email = $self->recode($myconfig->{email});
+ $email =~ s/[^\w\.\-\+=@]//ig;
+
+ my %temp_form = ( %{ $form }, 'myconfig_email' => $email );
+ my $template = SL::Template::create(type => 'PlainText', form => \%temp_form);
+ my $sendmail = $template->parse_block($main::sendmail);
+
+ if (!open(OUT, $sendmail)) {
+ $main::lxdebug->leave_sub();
+ return "$sendmail : $!";
+ }
+
+ $self->{charset} ||= Common::DEFAULT_CHARSET;
+ $self->{contenttype} ||= "text/plain";