Lines 21-27
use strict;
Link Here
|
21 |
use warnings; |
21 |
use warnings; |
22 |
|
22 |
|
23 |
use CGI; |
23 |
use CGI; |
24 |
use Encode; |
24 |
use Encode qw(decode encode); |
25 |
use Carp; |
25 |
use Carp; |
26 |
|
26 |
|
27 |
use Mail::Sendmail; |
27 |
use Mail::Sendmail; |
Lines 122-140
if ( $email ) {
Link Here
|
122 |
|
122 |
|
123 |
# Getting template result |
123 |
# Getting template result |
124 |
my $template_res = $template2->output(); |
124 |
my $template_res = $template2->output(); |
|
|
125 |
my $body; |
125 |
|
126 |
|
126 |
# Analysing information and getting mail properties |
127 |
# Analysing information and getting mail properties |
127 |
$mail{'subject'} = $template_res =~ /<SUBJECT>\n(.*)\n?<END_SUBJECT>/s |
128 |
if ( $template_res =~ /<SUBJECT>(.*)<END_SUBJECT>/s ) { |
128 |
? $1 : "no subject"; |
129 |
$mail{subject} = $1; |
|
|
130 |
$mail{subject} =~ s|\n?(.*)\n?|$1|; |
131 |
} |
132 |
else { $mail{'subject'} = "no subject"; } |
129 |
|
133 |
|
130 |
my ($email_header) = $template_res =~ /<HEADER>\n(.*)\n?<END_HEADER>/s; |
134 |
my $email_header = ""; |
|
|
135 |
if ( $template_res =~ /<HEADER>(.*)<END_HEADER>/s ) { |
136 |
$email_header = $1; |
137 |
$email_header =~ s|\n?(.*)\n?|$1|; |
138 |
} |
131 |
|
139 |
|
132 |
my $email_file = $template_res =~ /<FILENAME>\n(.*)\n?<END_FILENAME>/s |
140 |
my $email_file = "list.txt"; |
133 |
? $1 |
141 |
if ( $template_res =~ /<FILENAME>(.*)<END_FILENAME>/s ) { |
134 |
: "list.txt"; |
142 |
$email_file = $1; |
|
|
143 |
$email_file =~ s|\n?(.*)\n?|$1|; |
144 |
} |
135 |
|
145 |
|
136 |
my ($body) = $template_res =~ /<MESSAGE>\n(.*)\n?<END_MESSAGE>/s; |
146 |
if ( $template_res =~ /<MESSAGE>(.*)<END_MESSAGE>/s ) { |
137 |
$body = encode_qp($body); |
147 |
$body = $1; |
|
|
148 |
$body =~ s|\n?(.*)\n?|$1|; |
149 |
$body = encode("UTF-8", encode_qp($body)); |
150 |
} |
138 |
|
151 |
|
139 |
my $boundary = "====" . time() . "===="; |
152 |
my $boundary = "====" . time() . "===="; |
140 |
|
153 |
|
141 |
- |
|
|