use CGI;
use Encode qw(encode);
+use Carp;
use Mail::Sendmail;
use MIME::QuotedPrint;
}
else {
# do something if it doesnt work....
- warn "Error sending mail: $Mail::Sendmail::error \n";
+ carp "Error sending mail: $Mail::Sendmail::error \n";
$template->param( error => 1 );
}
$template->param( email_add => $email_add );
#!/usr/bin/perl
use strict;
#use warnings; FIXME - Bug 2505
+use Carp;
BEGIN {
# find Koha's Perl modules
# test carefully before changing this
'content-type' => 'text/html; charset="utf-8"',
);
# if we don't have any content for the mail, we don't launch mail, but notify it in a file
- if ($mailtext ne 'nonotifys') {
- sendmail(%mail);
- }
- else {
- print OUT $email ;
- }
+ if ($mailtext ne 'nonotifys') {
+ sendmail(%mail) or carp $Mail::Sendmail::error;
+ }
+ else {
+ print OUT $email ;
+ }
# now deal with the debarred mode
# if ($debarred eq 1) {
use Mail::Sendmail;
use Text::CSV_XS;
use CGI;
+use Carp;
use vars qw($VERSION);
foreach my $report (@ARGV) {
my ($sql, $type) = get_saved_report($report);
unless ($sql) {
- warn "ERROR: No saved report $report found";
+ carp "ERROR: No saved report $report found";
next;
}
$verbose and print "SQL: $sql\n\n";
Subject => $subject,
Message => $message
);
- sendmail(%mail) or warn "mail not sent";
+ sendmail(%mail) or carp 'mail not sent:' . $Mail::Sendmail::error;
} else {
print $message;
}
use C4::Context;
use C4::Search;
use C4::Circulation;
-use C4::Circulation::Fines;
use C4::Members;
use C4::Dates qw/format_date/;
use HTML::Template::Pro;
use Mail::Sendmail;
use Mail::RFC822::Address;
use C4::SMS;
+use Carp;
use utf8;
my ($res,$ua);##variables for SMS
if (not(sendmail %mail)) {
-warn $Mail::Sendmail::error;
- warn "sendEmail to $to failed.";
+carp "sendEmail to $to failed: " . $Mail::Sendmail::error;
return 0;
}
use CGI;
use Encode qw(encode);
+use Carp;
use Mail::Sendmail;
use MIME::QuotedPrint;
}
else {
# do something if it doesnt work....
- warn "Error sending mail: $Mail::Sendmail::error \n";
+ carp "Error sending mail: $Mail::Sendmail::error \n";
$template->param( error => 1 );
}
$template->param( email_add => $email_add );
use CGI;
use Encode qw(encode);
+use Carp;
use Mail::Sendmail;
use MIME::QuotedPrint;
}
else {
# do something if it doesnt work....
- warn "Error sending mail: $Mail::Sendmail::error \n";
+ carp "Error sending mail: $Mail::Sendmail::error \n";
$template->param( error => 1 );
}
use CGI;
use Encode qw(encode);
+use Carp;
use Mail::Sendmail;
use MIME::QuotedPrint;
}
else {
# do something if it doesnt work....
- warn "Error sending mail: $Mail::Sendmail::error \n";
+ carp "Error sending mail: $Mail::Sendmail::error \n";
$template->param( error => 1 );
}