- if ($out) {
- if (!open(OUT, $out)) {
- $main::lxdebug->leave_sub();
- return "$out : $!";
- }
- } else {
- if (!open(OUT, ">-")) {
- $main::lxdebug->leave_sub();
- return "STDOUT : $!";
- }
+ my $form = $main::form;
+ my $myconfig = \%main::myconfig;
+
+ my $email = $myconfig->{email};
+ $email =~ s/[^\w\.\-\+=@]//ig;
+
+ $form->{myconfig_email} = $email;
+
+ my $template = PlainTextTemplate->new(undef, $form, $myconfig);
+ my $sendmail = $template->parse_block($main::sendmail);
+
+ $self->{charset} = Common::DEFAULT_CHARSET unless $self->{charset};
+
+ if (!open(OUT, $sendmail)) {
+ $main::lxdebug->leave_sub();
+ return "$sendmail : $!";