Click here for a screen shot of the GUI in this script.


Addextender("WWWNT34I.DLL")
AddExtender("WWPST44I.DLL")
oper=wntGetUser(@DEFAULT)
user=wntUserProps("ds10001",oper,1)
parsedata(user)
email=strcat(param1,"_",param2,"@yourdomain.com")

MyDialogFormat=`WWWDLGED,6.1`
MyDialogCaption=`License update Util by C. Arconi`
MyDialogX=514
MyDialogY=033
MyDialogWidth=228
MyDialogHeight=136
MyDialogNumControls=008
MyDialogProcedure=`DEFAULT`
MyDialogFont=`DEFAULT`
MyDialogTextColor=`DEFAULT`
MyDialogBackground=`DEFAULT,DEFAULT`
MyDialogConfig=0
MyDialog001=`039,109,036,012,PUSHBUTTON,DEFAULT,"Send",1,1,32,DEFAULT,DEFAULT,DEFAULT`
MyDialog002=`139,109,036,012,PUSHBUTTON,DEFAULT,"Cancel",0,2,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog003=`009,009,146,012,STATICTEXT,DEFAULT,"GCOS License eMail utility",DEFAULT,4,DEFAULT,"Microsoft Sans Serif|6656|70|34","128|0|0",DEFAULT`
MyDialog004=`013,041,196,012,EDITBOX,MyVariable2,"Your Company GCOS License and Download.",DEFAULT,6,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog005=`015,031,100,008,STATICTEXT,DEFAULT,"Subject Line: (accept default or change)",DEFAULT,7,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog006=`037,081,032,008,STATICTEXT,DEFAULT,"Send log to:",DEFAULT,9,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog007=`013,063,194,040,GROUPBOX,DEFAULT,"Log recipient",DEFAULT,11,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
MyDialog008=`079,079,110,012,EDITBOX,email,"Edit 1",DEFAULT,10,DEFAULT,DEFAULT,DEFAULT,DEFAULT`
ButtonPushed=Dialog("MyDialog")

g="c:\gcos\gcos.txt"
s="c:\gcos\sent.txt"
validate=askyesno('Send License','Do you want to send an updated license to all addresses in the "gcos.txt" file?')
if validate==@NO
exit
else
txt=fileopen( g,"READ")
txt1=fileopen( s,"WRITE")
fileclose(txt1)
txt1=fileopen(s,"APPEND")
while @TRUE
gc=fileread(txt)
if gc=="*EOF*"
message("Finished","Check your email for sent list")
fileclose(txt)
fileclose(txt1)
gosub mail2
exit
endif
parsedata(gc)
gosub mail
filewrite(txt1,"%param1% sent update")
endwhile
endif

:MAIL
line1="Dear Customer,"
line2="Thank you for your purchase of the yourdomain software package."
line3="Please find below your Activation Code and the URL for the registration and download of your software."
line4="Activation Code: "
line5=param2
line6="URL for registering and downloading of software:"
line7="http://www.releasesoftware.whatever"
line8="Directions:"
line9="Step # 1: Go to the URL http://www.releasesoftware.whatever (copy the entire address above and then paste it into the web browser address field, then select 'Go' or click ENTER)"
line10="Step # 2: After the web page loads, enter the above Activation Code in the field provided."
line11="Step # 3: Follow the directions on the web page to register, download, and receive the license for your software."
line12="Step #4: Download and install any library files as needed from the your domain web site at: http://www.yourdomain.com/support/technical/libraryfilesmain.affx"
line13="If you have any questions on how to register, install or a preview of the software and detailed instructions on use, please go to the your company Technical Support website at:"
line14="http://www.yourdomain.com/support/technical/tutorials.affx"
line15="Need additional Help?"
line16="For US and Canada:"
line17="1-888-555-5555"
line18="For Europe: "
line19="+44 (0) 5555 555555"
line20="For Japan:"
line21="+81 3-5555-5555"
line22="For other countries please contact our distribution partners"

msg0=strcat(line1,@crlf,@crlf,line2,@crlf,line3,@crlf,@crlf,line4,line5,@crlf,@crlf,line6,@crlf,@crlf,line7,@crlf,@crlf,line8,@crlf,@crlf,line9,@crlf,@crlf,line10,@crlf,@crlf,line11,@crlf,@crlf,line12,@crlf,@crlf,line13,@crlf,@crlf,line14)
msg1=strcat(@crlf,@crlf,@crlf,@crlf,@crlf,line15,@crlf,line16,@crlf,line17,@crlf,line18,@crlf,line19,@crlf,line20,@crlf,line21)
msg3=strcat(msg0,msg1)

msg_lne= msg3
sbj_lne=""
host="email.yourdomain.com"
fromaddr="%email%"
userid="%usr_id%"
password=""
port=""
tolist= param1
cclist=""
bcclist=""
subject=MyVariable2
msg=msg_lne
attachments=""
flags=""
kInit(host,fromaddr,userid,password,port)
kDest(tolist,cclist,bcclist)
kSendText(subject,msg,attachments,flags)
return

:MAIL2
msg_lne="This message contains the list of users updated licenses were sent to."
sbj_lne=""
host="email.yourdomain.com"
fromaddr="%email%"
userid="%usr_id%"
password=""
port=""
tolist= "%email%"
cclist=""
bcclist=""
subject=sbj_lne
msg=msg_lne
attachments=s
flags=""
kInit(host,fromaddr,userid,password,port)
kDest(tolist,cclist,bcclist)
kSendText(subject,msg,attachments,flags)
return