Using Delphi 7 I wrote application utilizing SMTPSEND library
to send logs from server machines. In most cases it is invoked from
batch files which are called from Windows Task Scheduler.

I configured SMTPSEND to use TLS for SMTP connections, and everything
works fine when I run batch file manually.

However when batch file is executed from Task Scheduler, connection
fails. Debug version of application revealed that SMTPSEND procedures
failed to load libeay32.dll and ssleay32.dll placed in the same
directory where application resides.

I found the cause of that on SS64.com (http://ss64.com/nt/pushd.html):
"When a batch script is 'Run as Admin' in Vista or Windows 7, the
current directory will be set to C:\windows\system32\"

I found three not always working and unsatisfactory solutions:

1) Placing instruction >> pushd "%~dp0" << at the beginning of batch
(as adviced at SS64.com)
2) Using "start in" option in Windows Task Scheduler.
3) Placing libeay32.dll and ssleay32.dll in C:\windows\system32\

They are not universal because there are cases when my application is
executed without possibility to be run from batch file or task scheduler
and sometimes I have no authorizations to place anything in system32 folder.

What I need is a method to either a) learn SMTPSEND to locate and load
DLL files correctly (even when application gets false location from its
executing process) or b) embed these DLLs in my executable somehow.


Any help will be greatly appreciated.


------------------------------------------------------------------------------
_______________________________________________
synalist-public mailing list
synalist-public@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/synalist-public

Reply via email to