Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Professional Discussion / Execute file and return a value

Author
Message
GIDustin
18
Years of Service
User Offline
Joined: 30th May 2008
Location:
Posted: 26th Dec 2012 19:16
I am wanting to use DBPro to send emails. I found an EXE, SendSMTP.exe, that will send the emails if you just pass it parameters. It then returns a code designating it's success in doing so. Right now this BATCH file works great:



It captures the return code from the exe, writes it into Results.txt. There is only one problem, and that is the password (which I changed BTW) is stored in the batch file for all to see. Even if the batch file is deleted right afterwards, it is too much of a risk. I would much rather use execute file in DBPro to pass the values directly to the EXE (execute file "SendSMTP",arg$,"",1), but then I have no way of capturing that return code.

Any suggestions?
Jambo B
16
Years of Service
User Offline
Joined: 17th Sep 2009
Location: The Pit
Posted: 28th Dec 2012 00:01 Edited at: 28th Dec 2012 01:04
What about using another language to write a 'wrapper' around SendSMTP.exe?

Using C++, for example, you could call SendSMTP.exe then capture the return code and write it to the registry or a file. Your DBP program could then look for this value, or eventually timeout in case there was a problem.

You would pass the password to SendSMTP.exe via your 'wrapper' program, making it harder (but by no means impossible!) to detect than plain text in a script.

Cheers,

- James
The Weeping Corpse
14
Years of Service
User Offline
Joined: 19th Sep 2011
Location: United Kingdom
Posted: 28th Dec 2012 03:23
Your'e worrying too much. Even if you did implement a better way than you have already, a hacker would just write a fake SendSMTP.exe and capture the given args, password and all.

To make it more secure you need to investigate using a proper email API.

Chris Tate
DBPro Master
17
Years of Service
User Offline
Joined: 29th Aug 2008
Location: London, England
Posted: 28th Dec 2012 03:57
You can also send emails via a HTTP service; or server side script if you have one.

Login to post a reply

Server time is: 2026-07-08 05:58:19
Your offset time is: 2026-07-08 05:58:19