+ my ($self) = @_;
+
+ local (*IN, *OUT);
+
+ $num_sent++;
+ my $boundary = time() . "-$$-${num_sent}";
+ $boundary = "LxOffice-$self->{version}-$boundary";
+ my $domain = $self->{from};
+ $domain =~ s/(.*?\@|>)//g;
+ my $msgid = "$boundary\@$domain";
+
+ my $form = $main::form;
+ my $myconfig = \%main::myconfig;
+
+ my $email = $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";