Archived Forum Post

Index of archived forum posts

Question:

Updating Legacy VB6 from ChilkatEmail DLLs to Active X

Feb 20 '17 at 15:52

I inherited a legacy VB6 app that sends email using Chilkat Mail 5.1 that now needs to use SMTP TLS, but apparently the StartTLS property doesn't exist in Chilkat Mail 5.1. I downloaded and installed the newest Active X component (v9.5) and added the reference to the project, but am having trouble translating methods and properties to the new component.

Let me preface this by saying I have limited experience with VB, but here are my old declarations:

Dim Mailer As New CHILKATMAILLib.ChilkatMailMan
Dim MailFactory As New CHILKATMAILLib.EmailFactory
Dim msg As CHILKATMAILLib.IChilkatEmail

I tried using these declarations...

Dim Mailer As New ChilkatMailMan
Dim MailFactory As New ChilkatEmail
Dim msg As New ChilkatEmail

...but trying to invoke the method Set msg = MailFactory.NewEmail fails. I also tried invoking EmailBundle as MailFactory and use Set msg = MailFactory.AddEmail but that doesn't work either.

I know I'm not giving much to go on, but any help would be greatly appreciated as I an out of my depth here.

Thanks in Advance, vin


Accepted Answer

I think there must have been major changes to the object model since 5.1 as there doesn't appear to be an EmailFactory object anymore. You can now just create a new email object like this:

Dim msg As New Chilkat_v9_5_0.ChilkatEmail

I recommend having a look at the examples available here: https://www.example-code.com/vb6/emailObj.asp