projects
/
freeside.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
import sql-ledger 2.4.4
[freeside.git]
/
sql-ledger
/
SL
/
Mailer.pm
diff --git
a/sql-ledger/SL/Mailer.pm
b/sql-ledger/SL/Mailer.pm
index
934ad36
..
712b1d7
100644
(file)
--- a/
sql-ledger/SL/Mailer.pm
+++ b/
sql-ledger/SL/Mailer.pm
@@
-1,12
+1,12
@@
#=====================================================================
# SQL-Ledger Accounting
#=====================================================================
# SQL-Ledger Accounting
-# Copyright (C) 200
1
+# Copyright (C) 200
2
#
# Author: Dieter Simader
# Email: dsimader@sql-ledger.org
# Web: http://www.sql-ledger.org
#
#
# Author: Dieter Simader
# Email: dsimader@sql-ledger.org
# Web: http://www.sql-ledger.org
#
-# Contributors:
+# Contributors:
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
#
# This program is free software; you can redistribute it and/or modify
# it under the terms of the GNU General Public License as published by
@@
-21,6
+21,10
@@
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#======================================================================
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#======================================================================
+#
+# mailer package
+#
+#======================================================================
package Mailer;
package Mailer;
@@
-54,7
+58,15
@@
sub send {
my ($cc, $bcc);
$cc = "Cc: $self->{cc}\n" if $self->{cc};
$bcc = "Bcc: $self->{bcc}\n" if $self->{bcc};
my ($cc, $bcc);
$cc = "Cc: $self->{cc}\n" if $self->{cc};
$bcc = "Bcc: $self->{bcc}\n" if $self->{bcc};
-
+
+ foreach my $item (qw(from to cc bcc)) {
+ $self->{$item} =~ s/\\_/_/g;
+ $self->{$item} =~ s/\</</g;
+ $self->{$item} =~ s/\$<\$/</g;
+ $self->{$item} =~ s/\>/>/g;
+ $self->{$item} =~ s/\$>\$/>/g;
+ }
+
print OUT qq|From: $self->{from}
To: $self->{to}
${cc}${bcc}Subject: $self->{subject}
print OUT qq|From: $self->{from}
To: $self->{to}
${cc}${bcc}Subject: $self->{subject}
@@
-67,12
+79,15
@@
MIME-Version: 1.0
if ($self->{attachments}) {
print OUT qq|Content-Type: multipart/mixed; boundary="$boundary"
if ($self->{attachments}) {
print OUT qq|Content-Type: multipart/mixed; boundary="$boundary"
---${boundary}
+|;
+ if ($self->{message}) {
+ print OUT qq|--${boundary}
Content-Type: $self->{contenttype}; charset="$self->{charset}"
$self->{message}
|;
Content-Type: $self->{contenttype}; charset="$self->{charset}"
$self->{message}
|;
+ }
foreach my $attachment (@{ $self->{attachments} }) {
foreach my $attachment (@{ $self->{attachments} }) {