| View previous topic :: View next topic |
| Author |
Message |
Mike Guest
|
Posted: Wed Jan 18, 2006 11:36 am Post subject: Give a warning message before my ebook codes are used up. |
|
|
| I use your autoresponder to send a unique userid and password for ebooks that I sell. Is it possible your software to give a warning when the ebook codes it is dispensing gets down to a specific number? |
|
| Back to top |
|
 |
devicode Site Admin
Joined: 05 Mar 2005 Posts: 248
|
Posted: Wed Jan 18, 2006 11:58 am Post subject: |
|
|
Yes.
You can create a vbscript that will check the file size and when it is less then a certain amount it will send an email to you.
Your computer will not be able to directly send an email. You would need to either
1. Install IIS SMTP Service
2. Use a program that allows you to send an email from the command line. (You will also have to modify the script below to use the email utillity)
Here is a script that you can modify to suite your needs.
- Create a text file, LowCodes.vbs with the following text.
| Code: | 'Send an email if the product key file has just a few entries
Dim nFileSize
Dim oFS
Dim f
nFileSize = 0
Set oFS = CreateObject("Scripting.FileSystemObject")
If oFS.FileExists("C:\Program Files\ResponseMailer 3\sample-productkeys.txt") Then
Set f = oFS.GetFile("C:\Program Files\ResponseMailer 3\sample-productkeys.txt")
nFileSize = f.Size
End If
If nFileSize < 1000 Then
' Send the email
Dim oMessage
Set oMessage = CreateObject("CDO.Message")
oMessage.To = "you@somewhere.com"
oMessage.From = "you@somewhere.com"
oMessage.Subject = "Warning : Low registration codes"
oMessage.TextBody = "The registration codes file has just a few entries left." & vbCrLf & _
"The file size is " & nFileSize & " Bytes."
oMessage.Send
Set oMessage = Nothing
End If
|
You will need to modify the script to look at the correct text file that stores your userid and password.
To get Response Mailer autoreply to run the script
- Edit the Responder and click the Actions tab
- Add a 'Run a program' Action
- Select the LowCodes.vbs you created
- Click Ok
|
|
| Back to top |
|
 |
|