Reputation: 613
I have developed a .NET DLL in VisualStudio which should send e-mails via Outlook.
The developer of our ERP system wants to integrate this DLL and pass some parameters like sender and receiver, subject etc. to it.
He uses the following code:
OLEObject obj_OES
long RetValue
obj_OES = create OLEObject
RetValue = obj_OES.ConnectToNewObject("OutlookEMailSender.OutlookEMailSender")
Messagebox ( "ConnectToNewObject" , RetValue )
RetValue = obj_OES.object.SendMail("receiver","Test 1","account","sender","htmlbody","","C:\\data.pdf")
Messagebox ( "SendMail" , RetValue )
Our developer says that the code above only runs with registered DLLs.
Is there any other way to do that?
Upvotes: 0
Views: 2076
Reputation: 970
Why not just use OLE to interact with Outlook directly? The less moving parts the better. Here is a PowerBuilder code example:
http://www.topwizprogramming.com/freecode_outlook.html
Upvotes: 0
Reputation: 3809
You need to expose the .NET DLL as a COM library. Then PowerBuilder can consume it. You will need to register the DLL in the system the program will run on or use Registery-less COM.
Bruce Armstrong wrote an article explaining it here: http://pbdj.sys-con.com/node/397016
Upvotes: 2