Good afternoon Foxpro Guru's:
This is a modified email program of mine I posted yesterday.
Thank you,
PM
Error message - Variable 'Recvremail' is not found
VFP Debugger (crashing here): lcTarget = Recvremail
Click ignore, all my data will get to my Lotus Notes email. In the email form TO: False (due to my error)
So we know where the problem lies.
My target, Recvremail is the field that contains the email address in my Mails.dbf. For everr record/email I send I need the address to appear in the "TO" location hence, False appears. It just may be simple as declaring my variable?? any sugestions?
Code:
*****************************************************************
&&Program works with Lotus Notes.
Create Cursor testmail (signed c(1), Trackno i, Rdate d)
For ix=1 To 100
Insert Into testmail Values ;
(Chr(Asc('a')-1+Ceiling(Rand()*26)), ix, Date()-ix)
Endfor
Browse For signed = 'n' && Would email these
Local lcTarget, lcCurdir, oForm
lcCurdir = Sys(5)+Curdir()
Select testmail
oForm = Createobject("form")
oForm.AddObject("oSession","olecontrol","MSMAPI.mapiSession")
oForm.AddObject("oMessage","olecontrol","MSMAPI.mapiMessages")
oForm.oSession.signOn
With oForm.oMessage
.sessionid = oForm.oSession.sessionid
Scan For signed = 'n' && Would email these
lcTarget = recvremail &&The email field in the mails.dbf
.compose
Select mails
lcTempText = sys(2015)+'.tmp'
Set textmerge on
Set textmerge to (lcTempText) noshow
\Tracking Number : <>
\Carrier Name : <>
\Service Name : <>
\Date Received : <>
\Time Received : <>
\Rcv Clerk ID : <>
\Sender Name : <>
\Sender Address : <>
\Sender City : <>
\Sender State : <>
\Sender Zip : <>
\Phone Number : <>
Set textmerge to
Set textmerge off
lnHandle=fopen(lcTempText)
lnSize=fseek(lnHandle,0,2)
Fseek(lnHandle,0,0)
lcMyVar = fread(lnHandle,lnSize)
Fclose(lnHandle)
Erase (lcTempText)
.msgsubject = "Package Notification"
.msgnotetext = lcMyVar
.RecipAddress = lcTarget
.RecipType = 1
.ResolveName()
.Send(.F.)
Endscan
Endwith
Set Default To (lcCurdir)