View | Details | Raw Unified | Return to bug 12739
Collapse All | Expand All

(-)a/C4/Letters.pm (-12 / +26 lines)
Lines 429-437 sub SendAlerts { Link Here
429
                    from    => $branchdetails->{'branchemail'},
429
                    from    => $branchdetails->{'branchemail'},
430
                    replyto => $branchdetails->{'branchreplyto'},
430
                    replyto => $branchdetails->{'branchreplyto'},
431
                    sender  => $branchdetails->{'branchreturnpath'},
431
                    sender  => $branchdetails->{'branchreturnpath'},
432
                    subject => Encode::encode( "utf8", "" . $letter->{title} ),
432
                    subject => Encode::encode( "UTF-8", "" . $letter->{title} ),
433
                    message => $letter->{'is_html'} ? _wrap_html( Encode::encode( "utf8", $letter->{'content'} ), Encode::encode( "utf8", "" . $letter->{'title'}  ) ) : Encode::encode( "utf8", "" . $letter->{'content'} ),
433
                    message => $letter->{'is_html'}
434
                    contenttype => $letter->{'is_html'} ? 'text/html; charset="utf-8"' : 'text/plain; charset="utf-8"',
434
                                ? _wrap_html( Encode::encode( "UTF-8", $letter->{'content'} ),
435
                                              Encode::encode( "UTF-8", "" . $letter->{'title'} ))
436
                                : Encode::encode( "UTF-8", "" . $letter->{'content'} ),
437
                    contenttype => $letter->{'is_html'}
438
                                    ? 'text/html; charset="utf-8"'
439
                                    : 'text/plain; charset="utf-8"',
435
                }
440
                }
436
            );
441
            );
437
            sendmail(%mail) or carp $Mail::Sendmail::error;
442
            sendmail(%mail) or carp $Mail::Sendmail::error;
Lines 515-523 sub SendAlerts { Link Here
515
            To => join( ',', @email),
520
            To => join( ',', @email),
516
            Cc             => join( ',', @cc),
521
            Cc             => join( ',', @cc),
517
            From           => $userenv->{emailaddress},
522
            From           => $userenv->{emailaddress},
518
            Subject        => Encode::encode( "utf8", "" . $letter->{title} ),
523
            Subject        => Encode::encode( "UTF-8", "" . $letter->{title} ),
519
            Message => $letter->{'is_html'} ? _wrap_html( Encode::encode( "utf8", $letter->{'content'} ), Encode::encode( "utf8", "" . $letter->{'title'}  ) ) : Encode::encode( "utf8", "" . $letter->{'content'} ),
524
            Message => $letter->{'is_html'}
520
            'Content-Type' => $letter->{'is_html'} ? 'text/html; charset="utf-8"' : 'text/plain; charset="utf-8"',
525
                            ? _wrap_html( Encode::encode( "UTF-8", $letter->{'content'} ),
526
                                          Encode::encode( "UTF-8", "" . $letter->{'title'} ))
527
                            : Encode::encode( "UTF-8", "" . $letter->{'content'} ),
528
            'Content-Type' => $letter->{'is_html'}
529
                                ? 'text/html; charset="utf-8"'
530
                                : 'text/plain; charset="utf-8"',
521
        );
531
        );
522
532
523
        $mail{'Reply-to'} = C4::Context->preference('ReplytoDefault')
533
        $mail{'Reply-to'} = C4::Context->preference('ReplytoDefault')
Lines 564-572 sub SendAlerts { Link Here
564
                from    => $branchdetails->{'branchemail'},
574
                from    => $branchdetails->{'branchemail'},
565
                replyto => $branchdetails->{'branchreplyto'},
575
                replyto => $branchdetails->{'branchreplyto'},
566
                sender  => $branchdetails->{'branchreturnpath'},
576
                sender  => $branchdetails->{'branchreturnpath'},
567
                subject => Encode::encode( "utf8", "" . $letter->{'title'} ),
577
                subject => Encode::encode( "UTF-8", "" . $letter->{'title'} ),
568
                message => $letter->{'is_html'} ? _wrap_html( Encode::encode( "utf8", $letter->{'content'} ), Encode::encode( "utf8", "" . $letter->{'title'}  ) ) : Encode::encode( "utf8", "" . $letter->{'content'} ),
578
                message => $letter->{'is_html'}
569
                contenttype => $letter->{'is_html'} ? 'text/html; charset="utf-8"' : 'text/plain; charset="utf-8"',
579
                            ? _wrap_html( Encode::encode( "UTF-8", $letter->{'content'} ),
580
                                          Encode::encode( "UTF-8", "" . $letter->{'title'}  ) )
581
                            : Encode::encode( "UTF-8", "" . $letter->{'content'} ),
582
                contenttype => $letter->{'is_html'}
583
                                ? 'text/html; charset="utf-8"'
584
                                : 'text/plain; charset="utf-8"',
570
            }
585
            }
571
        );
586
        );
572
        sendmail(%mail) or carp $Mail::Sendmail::error;
587
        sendmail(%mail) or carp $Mail::Sendmail::error;
Lines 1132-1139 sub _send_message_by_email { Link Here
1132
1147
1133
    my $utf8   = decode('MIME-Header', $message->{'subject'} );
1148
    my $utf8   = decode('MIME-Header', $message->{'subject'} );
1134
    $message->{subject}= encode('MIME-Header', $utf8);
1149
    $message->{subject}= encode('MIME-Header', $utf8);
1135
    my $subject = encode('utf8', $message->{'subject'});
1150
    my $subject = encode('UTF-8', $message->{'subject'});
1136
    my $content = encode('utf8', $message->{'content'});
1151
    my $content = encode('UTF-8', $message->{'content'});
1137
    my $content_type = $message->{'content_type'} || 'text/plain; charset="UTF-8"';
1152
    my $content_type = $message->{'content_type'} || 'text/plain; charset="UTF-8"';
1138
    my $is_html = $content_type =~ m/html/io;
1153
    my $is_html = $content_type =~ m/html/io;
1139
    my $branch_email = undef;
1154
    my $branch_email = undef;
1140
- 

Return to bug 12739