Patch level : 12.0 900

Files correlati     : xvaga.dll
Commento            : Corretto invio mail con Powershell
This commit is contained in:
Simone Palacino 2019-11-14 14:40:05 +01:00
parent cdd8c1afd1
commit 6c861d9fdb

View File

@ -6,6 +6,7 @@
#include <wx/file.h> #include <wx/file.h>
#include <wx/filename.h> #include <wx/filename.h>
#include <wx/mimetype.h> #include <wx/mimetype.h>
#include <fstream>
static wxString GetMailParam(const char* key, const char* def = "") static wxString GetMailParam(const char* key, const char* def = "")
{ {
@ -394,8 +395,21 @@ BOOLEAN xvt_powermail_send(const char* to, const char* cc, const char* ccn,
); );
file.Close(); file.Close();
wxString command; wxString command;
command << "PowerShell -NonInteractive -NoProfile -Command \"& {"<< powerFile <<"; exit $LastExitCode }\""; command << "PowerShell -ExecutionPolicy ByPass -NonInteractive -NoProfile -Command \"& {" << powerFile << "; exit $LastExitCode }\"";
return system(command);; BOOLEAN sys_command = (BOOLEAN)system(command);
if (!sys_command)
{
std::ofstream fout;
wxString error_file;
error_file << userTemp << "\\" << "error_mail.txt";
fout.open(error_file, std::ios_base::out);
if (fout.is_open())
{
fout << command << "\n";
fout.close();
}
}
return sys_command;
} }