Topic "E-mail notification, help needed"

Author Message
costasppc
[View user's profile]

Joined: 2013-09-17
Posts: 3
Location: Athens
Hello,

I am using WinSCP command line (great tool) with the following script:

option batch continue
option confirm off
open <USER>@DOMAIN -passive=on
put C:\FiletoUpload\file
exit


I need to add an e-mail notification to get success or error. I have found in the WinSCP site the following script, but how to insert it in my script?

winscp.com /script=example.txt
if errorlevel 1 goto error

echo Success
sendmail.exe -t < success_mail.txt
goto end

:error
echo Error!
sendmail.exe -t < error_mail.txt

:end

Best regards

Kostas
Advertisements
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
That code is a Windows batch file that runs WinSCP (and its script). Not other way around.
_________________
Martin Prikryl
costasppc
[View user's profile]

Joined: 2013-09-17
Posts: 3
Location: Athens
Thank you for your reply,

Is there a way to combine both my code and the notification code?

Best regards

Kostas
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
In the above example the script.txt is your WinSCP script.
_________________
Martin Prikryl
costasppc
[View user's profile]

Joined: 2013-09-17
Posts: 3
Location: Athens
Thank you,

You mean the winscp.com /script=example.txt
martin
[View user's profile]
Site Admin
Joined: 2002-12-10
Posts: 25034
Location: Prague, Czechia
costasppc wrote:
You mean the winscp.com /script=example.txt

Yes. Sorry for mistake.
_________________
Martin Prikryl
Advertisements

You can post new topics in this forum






Search Site

What is WinSCP?

It is award-winning SFTP client, SCP client, FTPS client and FTP client integrated into one software program for file transfer to FTP server or secure SFTP server. [More]

And it's free!

Donate

About donations

$9   $19   $49   $99

About donations

Recommend

WinSCP Privacy Policy

WinSCP License