Patch level : 12.0 900
Files correlati : xvaga.dll Commento : Corretto invio mail con Powershell
This commit is contained in:
parent
cdd8c1afd1
commit
6c861d9fdb
@ -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 = "")
|
||||||
{
|
{
|
||||||
@ -395,7 +396,20 @@ 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;
|
||||||
}
|
}
|
Loading…
x
Reference in New Issue
Block a user