#!/usr/bin/perl
+# Copyright Doxulting 2004
+#
# This file is part of Koha.
#
# Koha is free software; you can redistribute it and/or modify it under the
# WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
# A PARTICULAR PURPOSE. See the GNU General Public License for more details.
#
-# You should have received a copy of the GNU General Public License along with
-# Koha; if not, write to the Free Software Foundation, Inc., 59 Temple Place,
-# Suite 330, Boston, MA 02111-1307 USA
+# You should have received a copy of the GNU General Public License along
+# with Koha; if not, write to the Free Software Foundation, Inc.,
+# 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
use strict;
use warnings;
my $body;
# Analysing information and getting mail properties
- if ( $template_res =~ /<SUBJECT>\n(.*)\n<END_SUBJECT>/s ) {
+ if ( $template_res =~ /<SUBJECT>\n(.*)\n?<END_SUBJECT>/s ) {
$mail{'subject'} = $1;
}
else { $mail{'subject'} = "no subject"; }
my $email_header = "";
- if ( $template_res =~ /<HEADER>\n(.*)\n<END_HEADER>/s ) {
+ if ( $template_res =~ /<HEADER>\n(.*)\n?<END_HEADER>/s ) {
$email_header = $1;
}
my $email_file = "basket.txt";
- if ( $template_res =~ /<FILENAME>\n(.*)\n<END_FILENAME>/s ) {
+ if ( $template_res =~ /<FILENAME>\n(.*)\n?<END_FILENAME>/s ) {
$email_file = $1;
}
- if ( $template_res =~ /<MESSAGE>\n(.*)\n<END_MESSAGE>/s ) { $body = encode_qp($1); }
+ if ( $template_res =~ /<MESSAGE>\n(.*)\n?<END_MESSAGE>/s ) {
+ $body = $1;
+ }
my $boundary = "====" . time() . "====";
- # $mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\"";
- #
- # $email_header = encode_qp($email_header);
- #
- # $boundary = "--".$boundary;
- #
- # # Writing mail
- # $mail{body} =
$mail{'content-type'} = "multipart/mixed; boundary=\"$boundary\"";
my $isofile = encode_base64(encode("UTF-8", $iso2709));
$boundary = '--' . $boundary;
$mail{body} = <<END_OF_BODY;
$boundary
-Content-Type: text/plain; charset="utf-8"
+MIME-Version: 1.0
+Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
$email_header