X-Git-Url: http://git.freeside.biz/gitweb/?a=blobdiff_plain;f=FS%2FFS%2Fcust_bill.pm;h=092c174b4feac5573aa9b6ba8413554f9bae7337;hb=d4dabf21a2c9022dfb7023fb5df49f1536b2f29a;hp=4306ea47793f473e8531e6231c199c0b863a23ac;hpb=c828daa905491e65deb30a2ed34af609cdb96b99;p=freeside.git diff --git a/FS/FS/cust_bill.pm b/FS/FS/cust_bill.pm index 4306ea477..092c174b4 100644 --- a/FS/FS/cust_bill.pm +++ b/FS/FS/cust_bill.pm @@ -388,7 +388,8 @@ sub send { #my @print_text = $cust_bill->print_text; #( date ) my @invoicing_list = $self->cust_main->invoicing_list; if ( grep { $_ ne 'POST' } @invoicing_list ) { #email invoice - $ENV{SMTPHOSTS} = $smtpmachine; + #false laziness w/FS::cust_pay::delete + #$ENV{SMTPHOSTS} = $smtpmachine; $ENV{MAILADDRESS} = $invoice_from; my $header = new Mail::Header ( [ "From: $invoice_from", @@ -402,8 +403,12 @@ sub send { 'Header' => $header, 'Body' => [ $self->print_text ], #( date) ); - $message->smtpsend - or return "Can't send invoice email to server $smtpmachine!"; + $!=0; + $message->smtpsend( Host => $smtpmachine ) + or $message->smtpsend( Host => $smtpmachine, Debug => 1 ) + or return "(customer # ". $self->custnum. ") can't send invoice email". + " to ". join(', ', grep { $_ ne 'POST' } @invoicing_list ). + " via server $smtpmachine with SMTP: $!"; #} elsif ( grep { $_ eq 'POST' } @invoicing_list ) { } elsif ( ! @invoicing_list || grep { $_ eq 'POST' } @invoicing_list ) { @@ -468,7 +473,7 @@ sub realtime_card { my($payname, $payfirst, $paylast); if ( $cust_main->payname ) { $payname = $cust_main->payname; - $payname =~ /^\s*([\w \,\.\-\']*\w)?\s+([\w\,\.\-\']+)$/ + $payname =~ /^\s*([\w \,\.\-\']*)?\s+([\w\,\.\-\']+)$/ or do { #$dbh->rollback if $oldAutoCommit; return "Illegal payname $payname"; @@ -878,7 +883,7 @@ sub print_text { =head1 VERSION -$Id: cust_bill.pm,v 1.18 2002-02-10 02:16:46 ivan Exp $ +$Id: cust_bill.pm,v 1.23 2002-03-18 19:49:10 ivan Exp $ =head1 BUGS