diff --git a/scripts/contracts/email_expire_services_to_customers.php b/scripts/contracts/email_expire_services_to_customers.php index def494d8159..d497274238e 100755 --- a/scripts/contracts/email_expire_services_to_customers.php +++ b/scripts/contracts/email_expire_services_to_customers.php @@ -245,6 +245,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldcustomer,$dura if ($mode == 'confirm') { $result=$mail->sendfile(); + if (! $result) + { + print "Error sending email ".$mail->error."\n"; + dol_syslog("Error sending email ".$mail->error."\n"); + } } else { diff --git a/scripts/contracts/email_expire_services_to_representatives.php b/scripts/contracts/email_expire_services_to_representatives.php index 08b6d9bde7d..9e070848235 100755 --- a/scripts/contracts/email_expire_services_to_representatives.php +++ b/scripts/contracts/email_expire_services_to_representatives.php @@ -244,6 +244,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta if ($mode == 'confirm') { $result=$mail->sendfile(); + if (! $result) + { + print "Error sending email ".$mail->error."\n"; + dol_syslog("Error sending email ".$mail->error."\n"); + } } else { diff --git a/scripts/invoices/email_unpaid_invoices_to_customers.php b/scripts/invoices/email_unpaid_invoices_to_customers.php index cf9e5f283b0..6de28e592c3 100755 --- a/scripts/invoices/email_unpaid_invoices_to_customers.php +++ b/scripts/invoices/email_unpaid_invoices_to_customers.php @@ -264,6 +264,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldtarget) if ($mode == 'confirm') { $result=$mail->sendfile(); + if (! $result) + { + print "Error sending email ".$mail->error."\n"; + dol_syslog("Error sending email ".$mail->error."\n"); + } } else { diff --git a/scripts/invoices/email_unpaid_invoices_to_representatives.php b/scripts/invoices/email_unpaid_invoices_to_representatives.php index 24577a75d21..1ceaee6bb18 100755 --- a/scripts/invoices/email_unpaid_invoices_to_representatives.php +++ b/scripts/invoices/email_unpaid_invoices_to_representatives.php @@ -239,6 +239,11 @@ function envoi_mail($mode,$oldemail,$message,$total,$userlang,$oldsalerepresenta if ($mode == 'confirm') { $result=$mail->sendfile(); + if (! $result) + { + print "Error sending email ".$mail->error."\n"; + dol_syslog("Error sending email ".$mail->error."\n"); + } } else {