8062 Followup for HTML::FormatText
[koha_fer] / opac / opac-sendbasket.pl
index 57d2c79..25f4349 100755 (executable)
@@ -120,39 +120,34 @@ if ( $email_add ) {
     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