Email

Advertisement

Firedawg
Guest

Email

Hi
I am new to writing batch files. I am looking to set up email notification if it failed or success for a upload. list below is my batch file.
@echo off

"C:\Program Files (x86)\WinSCP\WinSCP.com" ^
  /log="C:\FTPLogs\VCAL.log" /ini=nul ^
  /command ^
    "open sftp://******:******/ -hostkey=""*********""" ^
    "synchronize remote E:\VCAL /Diagnostics_******/VCAL" ^
    "exit"
 
set WINSCP_RESULT=%ERRORLEVEL%
if %WINSCP_RESULT% equ 0 (
  echo Success
) else (
  echo Error
)
 
exit/b %WINSCP_RESULT%

The batch file works I just don't know how to setup the email. Please help

Reply with quote

Advertisement

adel
Guest

sendmail.ini

Do i need to create this folder "\usr\lib" in C drive where the winscp install and copy sendmail.ini & sendmail.exe into it?

Reply with quote

martin
Site Admin
martin avatar
Joined:
Posts:
32,073
Location:
Prague, Czechia

Re: sendmail.ini

adel wrote:

Do i need to create this folder "\usr\lib" in C drive where the winscp install and copy sendmail.ini & sendmail.exe into it?
WinSCP does not interact with sendmail anyhow, so it does not care where you store it.
Just make sure the batch file can find it (either use an absolute path, or store the sendmail files along with the batch file).

Reply with quote

Advertisement

You can post new topics in this forum