berniebogs
MIS
FUNCTION SENDREPORT
parameter dfrom, dto
repstat=1
* LOCAL loapp as outlook.application, mynewmsg as outlook.message, ;
* lomailto as string
IF FILE("D:\AISLMAIN\REPORT\OUTPUT\REPORT.DBF")
* run /N2 "c:\program files\microsoft office\office12\outlook.exe"
objWMIService = GETOBJECT("winmgmts://./root/cimv2")
colItems = objWMIService.ExecQuery("Select * From Win32_Process Where Name = 'outlook.exe'")
if colitems.count=0
run /N "c:\program files\microsoft office\office12\outlook.exe"
do tpauser WITH '10'
endif
lomailto="xxxx@dsl.net"
loApp = GETOBJECT(,'Outlook.application')
mynewmsg = loApp.Createitem(olmailitem)
With mynewmsg
.recipients.add(lomailto)
.Attachments.Add("D:\AISLMAIN\REPORT\OUTPUT\REPORT.DBF")
if file("D:\AISLMAIN\REPORT\TRANFILE.DBF")
.Attachments.Add("D:\AISLMAIN\REPORT\OUTPUT\TRANFILE.DBF")
endif
if file("D:\AISLMAIN\REPORT\OUTPUT\CDC_INFO.DBF") and file("D:\AISLMAIN\REPORT\OUTPUT\CDC_DTLS.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\CDC_INFO.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\CDC_DTLS.DBF")
endif
if file("D:\AISLMAIN\REPORT\OUTPUT\DEP_INFO.DBF") and file("D:\AISLMAIN\REPORT\OUTPUT\DEP_DTLS.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\DEP_INFO.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\DEP_DTLS.DBF")
endif
if file("D:\AISLMAIN\REPORT\OUTPUT\ISSUED.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\ISSUED.DBF")
endif
if file("D:\AISLMAIN\REPORT\OUTPUT\IFMFILE.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\IFMFILE.DBF")
endif
.subject="AISL Report "+DTOC(dfrom)+" - "+DTOC(dto)
.htmlBody=" Auto reporting. "+DTOC(dfrom)+" - "+DTOC(dto)+". Generation:"+DTOC(date())+" "+time()
.send()
endwith
* loapp.quit
release loapp, mynewmsg,lomailto,objWMIService
tmp1="D:\AISLMAIN\REPORT\*.DBF"
delete file &tmp1
* run /N2 "c:\program files\microsoft office\office12\outlook.exe"
ELSE
repstat=0
ENDIF
RETURN repstat
we will migrate our emails, so please help me out here..
i have a program here, when i change the email addres to mis@some.com and run the program it always using xxxx@dsl.net. even though i change it.
i tried .recipients.add('mis@some.com') wont work also it always using xxx@dsl.net
i tried replacing xxxx@pdsl.net to mis@some.com wont work also
iam confused i cant find any more solutions
i attached the whle prg hope anyone can help me
parameter dfrom, dto
repstat=1
* LOCAL loapp as outlook.application, mynewmsg as outlook.message, ;
* lomailto as string
IF FILE("D:\AISLMAIN\REPORT\OUTPUT\REPORT.DBF")
* run /N2 "c:\program files\microsoft office\office12\outlook.exe"
objWMIService = GETOBJECT("winmgmts://./root/cimv2")
colItems = objWMIService.ExecQuery("Select * From Win32_Process Where Name = 'outlook.exe'")
if colitems.count=0
run /N "c:\program files\microsoft office\office12\outlook.exe"
do tpauser WITH '10'
endif
lomailto="xxxx@dsl.net"
loApp = GETOBJECT(,'Outlook.application')
mynewmsg = loApp.Createitem(olmailitem)
With mynewmsg
.recipients.add(lomailto)
.Attachments.Add("D:\AISLMAIN\REPORT\OUTPUT\REPORT.DBF")
if file("D:\AISLMAIN\REPORT\TRANFILE.DBF")
.Attachments.Add("D:\AISLMAIN\REPORT\OUTPUT\TRANFILE.DBF")
endif
if file("D:\AISLMAIN\REPORT\OUTPUT\CDC_INFO.DBF") and file("D:\AISLMAIN\REPORT\OUTPUT\CDC_DTLS.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\CDC_INFO.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\CDC_DTLS.DBF")
endif
if file("D:\AISLMAIN\REPORT\OUTPUT\DEP_INFO.DBF") and file("D:\AISLMAIN\REPORT\OUTPUT\DEP_DTLS.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\DEP_INFO.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\DEP_DTLS.DBF")
endif
if file("D:\AISLMAIN\REPORT\OUTPUT\ISSUED.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\ISSUED.DBF")
endif
if file("D:\AISLMAIN\REPORT\OUTPUT\IFMFILE.DBF")
.Attachments.add("D:\AISLMAIN\REPORT\OUTPUT\IFMFILE.DBF")
endif
.subject="AISL Report "+DTOC(dfrom)+" - "+DTOC(dto)
.htmlBody=" Auto reporting. "+DTOC(dfrom)+" - "+DTOC(dto)+". Generation:"+DTOC(date())+" "+time()
.send()
endwith
* loapp.quit
release loapp, mynewmsg,lomailto,objWMIService
tmp1="D:\AISLMAIN\REPORT\*.DBF"
delete file &tmp1
* run /N2 "c:\program files\microsoft office\office12\outlook.exe"
ELSE
repstat=0
ENDIF
RETURN repstat
we will migrate our emails, so please help me out here..
i have a program here, when i change the email addres to mis@some.com and run the program it always using xxxx@dsl.net. even though i change it.
i tried .recipients.add('mis@some.com') wont work also it always using xxx@dsl.net
i tried replacing xxxx@pdsl.net to mis@some.com wont work also
iam confused i cant find any more solutions
i attached the whle prg hope anyone can help me