close $temp_fh;
if ($template->uses_temp_file() || $self->{media} eq 'email') {
- $out = $self->{OUT};
- $out_mode = $self->{OUT_MODE} || '>';
- $self->{OUT} = "$self->{tmpfile}";
+ $out = $self->{OUT};
+ $out_mode = $self->{OUT_MODE} || '>';
+ $self->{OUT} = "$self->{tmpfile}";
$self->{OUT_MODE} = '>';
}
# if we send html or plain text inline
if (($self->{format} eq 'html') && ($self->{sendmode} eq 'inline')) {
- $mail->{contenttype} = "text/html";
-
- $mail->{message} =~ s/\r//g;
- $mail->{message} =~ s/\n/<br>\n/g;
- $myconfig->{signature} =~ s/\n/<br>\n/g;
- $mail->{message} .= "<br>\n-- <br>\n$myconfig->{signature}\n<br>";
+ $mail->{contenttype} = "text/html";
+ $mail->{message} =~ s/\r//g;
+ $mail->{message} =~ s/\n/<br>\n/g;
+ $myconfig->{signature} =~ s/\n/<br>\n/g;
+ $mail->{message} .= "<br>\n-- <br>\n$myconfig->{signature}\n<br>";
open(IN, "<", $self->{tmpfile})
or $self->error($self->cleanup . "$self->{tmpfile} : $!");
- while (<IN>) {
- $mail->{message} .= $_;
- }
-
+ $mail->{message} .= $_ while <IN>;
close(IN);
} else {
#print(STDERR "OUT $self->{OUT}\n");
for my $i (1 .. $self->{copies}) {
if ($self->{OUT}) {
- open OUT, $self->{OUT_MODE}, $self->{OUT} or $self->error($self->cleanup . "$self->{OUT} : $!");
+ open OUT, $self->{OUT_MODE}, $self->{OUT} or $self->error($self->cleanup . "$self->{OUT} : $!");
print OUT $_ while <IN>;
close OUT;
- seek IN, 0, 0;
+ seek IN, 0, 0;
} else {
$self->{attachment_filename} = ($self->{attachment_filename})
delete $form->{OUT};
if ($form->{media} eq 'printer') {
- #$form->{OUT} = "| $form->{printer_command} &>/dev/null";
$form->{OUT} = $form->{printer_command};
$form->{OUT_MODE} = '|-';
$form->{printed} .= " $form->{formname}";