I wrote this script to capture my morning routines and email the results to me, however, the set capture file does not seem to be working. It just openes the default file.
Any ideas?
Thanks
proc main
set capture file "C:\Program Files\Symantec\Procomm Plus\Capture\Plaza 2.cap"
set capture overwrite on
waituntil "6:28:00"
mr ()
endproc
proc sendit
transmit "^M"
endproc
proc mr
capture on
transmit "****LOGI ******^M"
waitfor "PASS?"
transmit "******^M"
waitfor ">"
transmit "ld 60^M"
waitfor "."
transmit "stat^M"
waitfor "." FOREVER
transmit "lcnt^M"
waitfor "."
transmit "!"
waitfor ">"
transmit "ld 96^M"
waitfor "."
transmit "stat dch^M"
waitfor "."
transmit "!"
capture off
mailit () ; and start a new one.
endproc
proc mailit
string sEmailfile = "C:\Program Files\Symantec\Procomm Plus\Capture\pl2.txt" ;szFileName ;Receives string input of file specificaton
string aEmail_files[100] ;string array for files to attach to each email
string sEmail_lne ;string for dialogbox error message
string sEmail_temp ;string to
integer iCounter = 1 ;integer used for various loops
integer iE_counter = 0 ;integer to log number of files to send
integer iEmail_Length ;integer to record length of email file string
integer iTemp_Length ;integer to check modified email string length
;is less than 255
string sMailLogon = "" ;Mail logon/profile name
string sMailPassword = "" ;Not needed if using Exchange Server
string sTo = "chad.simon@lpl.com;craig.lyons@lpl.com;ronald.reddon@lpl.com" ;Recipients as they appear in the Outlook address book or enter just email address
string sCC = "" ;CC recipients
string sBCC = "" ;BCC recipients
string sSubject = "Morning routine from Plaza 2" ;Subject of the message
string sContents = "Morning Routine" ;text appearing in body of message
string sMailError
while iCounter !=100
aEmail_files[iCounter]=""
iCounter ++
endwhile
iE_counter=1
if findfirst sEmailfile
strlen aEmail_files[iE_counter] iTemp_Length
strlen $filespec iEmail_Length
if (iTemp_Length + iEmail_Length) < 255
strcat aEmail_files[iE_counter] $filespec
strcat aEmail_files[iE_counter] ";"
else
iE_counter ++
strcat aEmail_files[iE_counter] $filespec
strcat aEmail_files[iE_counter] ";"
endif
while findnext
sEmail_temp=aEmail_files[iE_counter]
strlen aEmail_files[iE_counter] iTemp_Length
strlen $filespec iEmail_Length
if (iTemp_Length + iEmail_Length) < 255
strcat aEmail_files[iE_counter] $filespec
strcat aEmail_files[iE_counter] ";"
else
iE_counter ++
strcat aEmail_files[iE_counter] $filespec
strcat aEmail_files[iE_counter] ";"
endif
if iE_counter==100
dialogbox 1 41 31 264 66 15 "WARNING"
text 1 32 26 200 12 "**NUMBER of EMAILs too high (>99)**" center
enddialog
pause 1
exitwhile
endif
endwhile
endif
iE_counter=1
if nullstr aEmail_files[1]
dialogbox 1 41 31 264 66 11 "INFORMATION"
text 1 72 26 120 12 "**NO EMAILS TO PROCESS**" center
enddialog
goto end_email
endif
while not stricmp aEmail_files[iE_counter] ""
mapisend sMailLogon sMailPassword sTo sCC sBCC sSubject sContents aEmail_files[iE_counter] sMailError
if SUCCESS
dialogbox 1 41 31 264 66 11 "INFORMATION"
text 1 72 26 120 12 "**EMAILS PROCESSED OK**" center
enddialog
else
strfmt sEmail_lne "**EMAIL ERROR DETECTED** (%s)" sMailError
dialogbox 1 41 31 264 66 11 "INFORMATION"
text 1 19 26 227 12 sEmail_lne center
enddialog
pause 1
endif
iE_counter ++
endwhile
end_email:
pause 1
dlgdestroy 1 cancel
halt
endproc
Any ideas?
Thanks
proc main
set capture file "C:\Program Files\Symantec\Procomm Plus\Capture\Plaza 2.cap"
set capture overwrite on
waituntil "6:28:00"
mr ()
endproc
proc sendit
transmit "^M"
endproc
proc mr
capture on
transmit "****LOGI ******^M"
waitfor "PASS?"
transmit "******^M"
waitfor ">"
transmit "ld 60^M"
waitfor "."
transmit "stat^M"
waitfor "." FOREVER
transmit "lcnt^M"
waitfor "."
transmit "!"
waitfor ">"
transmit "ld 96^M"
waitfor "."
transmit "stat dch^M"
waitfor "."
transmit "!"
capture off
mailit () ; and start a new one.
endproc
proc mailit
string sEmailfile = "C:\Program Files\Symantec\Procomm Plus\Capture\pl2.txt" ;szFileName ;Receives string input of file specificaton
string aEmail_files[100] ;string array for files to attach to each email
string sEmail_lne ;string for dialogbox error message
string sEmail_temp ;string to
integer iCounter = 1 ;integer used for various loops
integer iE_counter = 0 ;integer to log number of files to send
integer iEmail_Length ;integer to record length of email file string
integer iTemp_Length ;integer to check modified email string length
;is less than 255
string sMailLogon = "" ;Mail logon/profile name
string sMailPassword = "" ;Not needed if using Exchange Server
string sTo = "chad.simon@lpl.com;craig.lyons@lpl.com;ronald.reddon@lpl.com" ;Recipients as they appear in the Outlook address book or enter just email address
string sCC = "" ;CC recipients
string sBCC = "" ;BCC recipients
string sSubject = "Morning routine from Plaza 2" ;Subject of the message
string sContents = "Morning Routine" ;text appearing in body of message
string sMailError
while iCounter !=100
aEmail_files[iCounter]=""
iCounter ++
endwhile
iE_counter=1
if findfirst sEmailfile
strlen aEmail_files[iE_counter] iTemp_Length
strlen $filespec iEmail_Length
if (iTemp_Length + iEmail_Length) < 255
strcat aEmail_files[iE_counter] $filespec
strcat aEmail_files[iE_counter] ";"
else
iE_counter ++
strcat aEmail_files[iE_counter] $filespec
strcat aEmail_files[iE_counter] ";"
endif
while findnext
sEmail_temp=aEmail_files[iE_counter]
strlen aEmail_files[iE_counter] iTemp_Length
strlen $filespec iEmail_Length
if (iTemp_Length + iEmail_Length) < 255
strcat aEmail_files[iE_counter] $filespec
strcat aEmail_files[iE_counter] ";"
else
iE_counter ++
strcat aEmail_files[iE_counter] $filespec
strcat aEmail_files[iE_counter] ";"
endif
if iE_counter==100
dialogbox 1 41 31 264 66 15 "WARNING"
text 1 32 26 200 12 "**NUMBER of EMAILs too high (>99)**" center
enddialog
pause 1
exitwhile
endif
endwhile
endif
iE_counter=1
if nullstr aEmail_files[1]
dialogbox 1 41 31 264 66 11 "INFORMATION"
text 1 72 26 120 12 "**NO EMAILS TO PROCESS**" center
enddialog
goto end_email
endif
while not stricmp aEmail_files[iE_counter] ""
mapisend sMailLogon sMailPassword sTo sCC sBCC sSubject sContents aEmail_files[iE_counter] sMailError
if SUCCESS
dialogbox 1 41 31 264 66 11 "INFORMATION"
text 1 72 26 120 12 "**EMAILS PROCESSED OK**" center
enddialog
else
strfmt sEmail_lne "**EMAIL ERROR DETECTED** (%s)" sMailError
dialogbox 1 41 31 264 66 11 "INFORMATION"
text 1 19 26 227 12 sEmail_lne center
enddialog
pause 1
endif
iE_counter ++
endwhile
end_email:
pause 1
dlgdestroy 1 cancel
halt
endproc