jakc
18th September 2011 11:40 UTC
Send Email via NSIS?
I have been looking at related posts and also hunting about with google.
For my software product (web application) clients will need to request a license from us before installing it.
We would need to check if they are a paying client (a manual process at the moment).
I need the ability for one of the initial steps of my installer to be let user request license via a custom page in the NSIS installer.
They would put in some mandatory fields and then this would get fired off in an email.
Ideally, NSIS would let them know that the email had successfully been sent.
They would then exit the wizard, but when we verify who they are and send them a serial, they can run installer again, and there would be an option to enter the serial, allowing them to progress to the next screen.
It is the emailing bit that I am currently stumped on.
I have not seen any plugins to do this.
What would be the best plan of attack to achieve this?
A rough mockup of what I imagine this custom page would look like.
LoRd_MuldeR
18th September 2011 16:44 UTC
Why does the registration info have to be sent to the server as e-mail?
You cannot use HTTP POST instead? This would be easy to do with inetc::post in NSIS!
It should be easy to pass the info to a PHP script on the server via HTTP POST.
http://php.net/manual/en/reserved.variables.post.php
LoRd_MuldeR
18th September 2011 17:01 UTC
Okay, I have put together a simple example in 5 minutes ;)
Give this one a try:
http://www.mediafire.com/?82n36t5dzd0umve
Client NSIS Code:
http://pastie.org/private/4rsw5ujsrijvyhaxqlana
Server PHP Code:
http://pastie.org/private/1pqivzqy97gvxm75oxmmow
jakc
18th September 2011 23:26 UTC
Needs to be an email
We dont have anything at the server end to store the POST operation in.
But appreciate your efforts. :)
LoRd_MuldeR
18th September 2011 23:38 UTC
It should be trivial to make the server script save the request.
You can, for example, make the server script save a simple text file for each request.
It can save the requests on a network share, e.g. on some machine you have direct access to.
Or you can even make the server script emit an e-mail, if you insist ;)
See:
http://php.net/manual/en/function.mail.php
Script Example:
http://pastie.org/private/5y0dieicrj1pnimt5iprjg