I use this code to send email from my application :
Code: Select all
oOutLook := CreateObject("Outlook.Application")
oMail := oOutLook:CreateItem(olMailItem)
oMail:Subject := ALLTRIM(EmOnde)
oMail:Body := ALLTRIM(FmText)
oMail:Recipients:Add(cEmail[i])
oMail:CC := TabCC
oMail:BCC := TabBCC
FOR j=1 TO LEN(TabBijl)
oMail:Attachments:Add(TabBijl[j])
NEXT
oMail:HTMLBody := MEMOREAD(ALLTRIM(US->UOUTLSJAB))
oMail:Send()
To prevent the error from happening, I have to open Outlook 2007 before I run my application.Error discription : E_FAIL:Recepients
Win32ole => TOLEAUTO:RECIPIENTS
But this wasn't the case with Outlook 2000, XP or 2003. I didn't need to open Outlook before running my application.
Can anyone tell me how this problem can be solved ?
Thank you.