From cf6620a4460a772d182d09c0d2159ce47545aaeb Mon Sep 17 00:00:00 2001 From: smen Date: Tue, 19 Oct 2021 15:49:17 +0200 Subject: [PATCH] Patch level : 12.0 nopatch Files correlati : Commento : Modifiche invio mail tramite campo --- src/xvaga/xvtmail.cpp | 39 +-------------------------------------- 1 file changed, 1 insertion(+), 38 deletions(-) diff --git a/src/xvaga/xvtmail.cpp b/src/xvaga/xvtmail.cpp index 1987f1832..eb8f9df8b 100755 --- a/src/xvaga/xvtmail.cpp +++ b/src/xvaga/xvtmail.cpp @@ -437,65 +437,28 @@ BOOLEAN xvt_powermail_send(const char* to, const char* cc, const char* ccn, "$smtp = new-object Net.Mail.SmtpClient($Server, $Port);\n" "$smtp.EnableSSL = $SSL;\n" "$smtp.Credentials = New-Object System.Net.NetworkCredential($Username, $Password);\n" - "$exitCode = 1\n" "try\n" "{\n" " $smtp.send($message);\n" " write-host \"E-Mail sent\" \n" " $exitCode = 1 \n" - " Out-File -FilePath \"C:\\Users\\smen\\Desktop\\Pmail\\ExitCode.txt\" -InputObject $exitCode \n" " exit $exitCode \n" "}\n" "catch\n" "{\n" " write-host \"E-Mail not sent\" ; \n" " $exitCode = 0 \n" - " Out-File -FilePath \".\ExitCode.txt\" -InputObject $exitCode \n" " exit $exitCode \n" "}\n" ); file.Close(); wxString command("powershell.exe -File "); -// command << R"(PowerShell -ExecutionPolicy ByPass -NonInteractive -NoProfile -Command "{)" << powerFile << R"(; exit $LastExitCode }")"; //una volta scritto lo scritp ps1 cos'è che lo runna? Dove vinene aperta la PowerShell? // al momento lo script generato da campo funziona se runnato direttamente da powershell command << powerFile; int exit = xvt_sys_execute(command, true, true); -//nt exit = system( + powerFile); - - //wxString exitFile; - //wxString exitFileName = "ExitCode.txt"; - //xvt_fsys_build_pathname(exitFile.GetWriteBuf(_MAX_PATH), NULL, userTemp, exitFileName, NULL , NULL); - //exitFile.UngetWriteBuf(); - - // Creo il file di log - //wxTextFile logFile; - //logFile.Open(exitFile); - //wxString logStr = logFile.GetFirstLine(); - //int exitCode; - //exitCode = wxAtoi(logStr); - - //system("powershell.exe $lastexitcode"); - - /* - 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(); - } - } - */ - //sys.command; - return exit -; + return exit; }