diff options
Diffstat (limited to 'src/file')
-rw-r--r-- | src/file/mail.cpp | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/file/mail.cpp b/src/file/mail.cpp index 2a2231b..403ed84 100644 --- a/src/file/mail.cpp +++ b/src/file/mail.cpp @@ -40,6 +40,8 @@ namespace smtp::file static const std::string METHOD_NAME = "Write mails"; std::ofstream mail_file{ mPathFile, std::fstream::out | std::fstream::trunc }; + bool result = true; + if ( !mail_file.is_open() ) { logger::LoggerSet::GetInstance()->LogError( METHOD_NAME, "Unable to open file to write " + mPathFile ); @@ -51,8 +53,12 @@ namespace smtp::file { mail_file << mail << "\n"; } + else + { + result = false; + } } mail_file.close(); - return true; + return result; } } |