by driessen » Sun Dec 14, 2014 8:20 pm
Antonio,
Very strange. I always use this code :
- Code: Select all Expand view
#INCLUDE "MAIL.CH"
..................
local EmSend := .T.
local ErOutlook,ErMail,ErNameSpace
..................
TRY
GetActiveObject("Outlook.Application")
CATCH
ShellExecute(,"Open","Outlook",,,7)
END
TRY
ErOutLook := TOleAuto():New("Outlook.Application")
ErNameSpace := ErOutLook:GetNameSpace("MAPI")
EmSend := .T.
CATCH
EmSend := .F.
END
TRY
IF EmSend
ErMail := ErOutlook:CreateItem(olMailItem)
ErMail:Subject := ALLTRIM("Juda(32)-foutmelding - " + ALLTRIM(PAR->GKANTOOR))
ErMail:Body := "Klant : " + ALLTRIM(PAR->GKANTOOR) + CRLF + "Gebruiker : " + ALLTRIM(US->USERNAAM) + CRLF + "Datum : " + DTOC(DATE()) + CRLF + "Uur : " + TIME() + CRLF + CRLF + "Juda(32)-foutmelding : zie bijlage !!!"
ErMail:Recipients:Add("michel.driessen@ma-consult.be")
ErMail:Attachments:Add(EmFile)
ErMail:Display()
ENDIF
CATCH
EmSend := .F.
END
This code is working just fine in Harbour as well as in xHarbour, with different versions of Outlook starting 2007.
Regards,
Michel D.
Genk (Belgium)
_____________________________________________________________________________________________
I use : FiveWin for (x)Harbour v. 24.02 - Harbour 3.2.0 (February 2024) - xHarbour Builder (January 2020) - Bcc77