To All
I have a corporate Customer that has been using Classic MS Outlook and this code has worked fine up until my CUstomer has upgraded several workstations to MS and Outlook 365 .. We have determined that the Classic Outlook computers sent the e-mail but the same program running on computers that have Outlook 365 do not get sent .. here is the Original code that works with Classic Outlook
Func Main()
Local cSubject,cTo,cOther,cBody,cCC
Local oOutlook,oMailItem
cTo := "twatson@doi.sc.gov"
cOther := "watsonjt@mindspring.com"
cCC := "r1.1955@live.com;watsonjt@mindspring.com"
cSubject := "Travel Train Request for Rick Lipkin, Dates 06/01/2020 thru 06/10/2020"
cBody := "Dear Supervisor : John ( Tommy ) Watson;"+chr(10)
cBody += " "+chr(10)
cBody += " "+chr(10)
cBody += "A Travel / Train request has been submitted for your review and approval. Please click on the Link"+chr(10)
cBody += "Provided below."+chr(10)
cBody += " "+chr(10)
cBody += "Summary of Request:"+chr(10)
cBody += " "+chr(10)
cBody += " * Employee Name: Rick Lipkin"+chr(10)
cBody += " * Vendor Sponsor: Microsoft"+chr(10)
cBody += " * Conference/Event: Building an Asure Network"+chr(10)
cBody += " * Location: Columbia SC"+chr(10)
cBody += " * Start Date: 06/01/2020"+chr(10)
cBody += " * End Date: 06/10/2020"+chr(10)
cBody += " * Estimated Cost: $500.00"+chr(10)
cBody += " * Is This Associated with a Previously approved Designation? : No"+chr(10)
cBody += " "+chr(10)
cBody += " "+chr(10)
* cBody += "file://printserver/scid/0000%20Human%20Resources/Master%20Leave%20Program/%20LeaveW32.Exe"
cBody += " "+chr(10)
cBody += " "+chr(10)
cBody += " "+chr(10)
cBody += " "+chr(10)
cBody += " "+chr(10)
cBody += " "+chr(10)
cBody += "Note .. This is an automated e-mail sent from the Leave / Travel Program"+chr(10)
cBody += " "+chr(10)
oOutLook := TOleAuto():New("Outlook.Application") // works with Classic not Outlook 365
oMailItem := oOutLook:Invoke("CreateItem", 0)
oMailitem:to := cTo
*oMailItem:Recipients:Add( cOther )
oMailitem:CC := cCC
oMailItem:Subject := cSubject
oMailItem:Body := cBody
*if ! empty(cPdf)
* oMailItem:Attachments:Add(cPdf)
*endif
oMailItem:display(.F.)
oMailItem:Invoke("Send")
sysrefresh()
msginfo( "E-mail Sent" )
return .T.I would appreciate if anyone has the Outlook 365 API code that will send the e-mail with 365 installed.
Many thanks
Rick Lipkin