noalyss-commit
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Noalyss-commit] [noalyss] 16/46: Improve email sent : check if file att


From: Dany De Bontridder
Subject: [Noalyss-commit] [noalyss] 16/46: Improve email sent : check if file attached
Date: Tue, 13 Jul 2021 05:01:53 -0400 (EDT)

sparkyx pushed a commit to branch master
in repository noalyss.

commit f8142caf689e7f65b063b81e1c257f05bd3481b2
Author: sparkyx <danydb@noalyss.eu>
AuthorDate: Sat Jun 12 10:54:07 2021 +0200

    Improve email sent : check if file attached
---
 include/lib/sendmail_core.class.php | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/include/lib/sendmail_core.class.php 
b/include/lib/sendmail_core.class.php
index 35f49be..cb93ca7 100644
--- a/include/lib/sendmail_core.class.php
+++ b/include/lib/sendmail_core.class.php
@@ -151,9 +151,14 @@ class Sendmail_Core
             // attachment
             for ($i = 0; $i < count($this->afile); $i++)
             {
+                
                 $file = $this->afile[$i];
                 $file_size = filesize($file->full_name);
                 $handle = fopen($file->full_name, "r");
+                if ( $handle == false ){ 
+                    \record_log("SC159 ".var_export($file,true));
+                    throw new Exception ('SC159 email not send file not 
added'.$file->full_name);
+                }
                 $content = fread($handle, $file_size);
                 fclose($handle);
                 $content = chunk_split(base64_encode($content));



reply via email to

[Prev in Thread] Current Thread [Next in Thread]