Hi George,
I use SwithMail with satisfaction.
The website
https://www.tbare.com/software/swithmail/ has detailed instructions on how to use it.
My copy of the program:
If File(cXml)
cParam:=' /s /x "SwithMailSettings_'+MyTrim(oSrv:FIELDGET(#Id),"0")+'.xml"'
lOk :=RunPrg(self,cExe,cParam,Filepath2(cExe),nSw) == 0 //
if !lOk //Ha nem sikerül az email küldés
// WB(, cError2)
Fajlbair(oSrv:FIELDGET(#Mail_Settings_XML),"EmailLog.txt")
ShellExecute(null,String2Psz("open"),String2Psz("EmailLog.txt"),null,null,SW_SHOWNORMAL)
else
//WB("Ok!")
oSrv:FIELDPUT(#Sent_To,true)
oSrv:FIELDPUT(#Send_Date,GetTimeStamp())
oSrv:Commit()
nElkuldve+=1
endif
endif
function RunPrg(oWin as object,cEXEfile as string,cParameters:="" as string, cWorkDir as string, nShow:=SW_NORMAL as word) as dword //EXE Run
local SEInfo as _WinShellExecuteInfo
local hProc as ptr
local lpExitCode := 999 as dword
local lRunning as logic
local lSuccess as logic
if oWin <> null_object
oWin:Pointer := Pointer{ POINTERHOURGLASS }
endif
SEInfo := MemAlloc(_sizeof(_winSHELLEXECUTEINFO))
SEInfo.cbSize := _sizeof(_winSHELLEXECUTEINFO)
SEInfo.fMask := SEE_MASK_NOCLOSEPROCESS + SEE_MASK_FLAG_NO_UI
SEInfo.lpVerb := psz(_cast, "open")
SEInfo.lpFile := psz(_cast, cExeFile )
SEInfo.lpParameters := psz(_cast, cParameters )
SEInfo.lpDirectory := String2Psz(cWorkDir)
SEInfo.nShow := nShow//SW_NORMAL, SW_HIDE
SEInfo.hInstApp := null_ptr
SEInfo.lpClass := null_psz
if ShellExecuteEx(SEInfo) // File executed correctly
hProc := SEInfo.hProcess
GetExitCodeProcess( hProc, @lpExitCode )
lRunning := ( lpExitCode = STILL_ACTIVE )
do while lRunning // Wait until finishes
GetExitCodeProcess( hProc, @lpExitCode )
lRunning := ( lpExitCode = STILL_ACTIVE )
YML()
enddo
lSuccess := true
CloseHandle(SEInfo.hProcess)
MemFree(SEInfo) // File was executed and the execution finished
else
// An error occured (use GetLastError() to see what happened)
MemFree(SEInfo)
endif
if oWin <> null_object
oWin:Pointer := Pointer{ POINTERARROW }
endif
return lpExitCode
Kind Regards,
Szepligeti Ferenc
Γεωργιος Τριτσος ezt írta (2023. június 7., szerda, 22:22:31 UTC+2):
Hi all,
Does anyone have expirience with SwithMail . I would really appreciate if someone have a sample.
Thanks all
George
--- SoupGate-Win32 v1.05
* Origin: fsxNet Usenet Gateway (21:1/5)