I use is piece of code in a VB6 application which sends an e-mail with an attachment.
This is the code:
This was working fine.
Recently we changed to another mailserver. Previously we used a POP-account but now we use an IMAP-account (Kerio Mailserver). We connect using the Kerio Outlook Connector.
Since that change my code doesn't work anymore.
The message is still created. The body, subject and To are correct. Even the attachment is correct, but when I send the message (using the sendbutton on the Outlook mail window) Outlook hangs and the message isn't send.
When I 'manually' create the message with the same body, subject, To and attachment all goes well.
Can anybody help me? I'm getting realy deperate.
Thanks
Paul
The Netherlands
This is the code:
Code:
Dim objOutlook As Object
Dim objOutlookMsg As Object
Set objOutlook = CreateObject("Outlook.Application")
Set objOutlookMsg = objOutlook.CreateItem(0)
With objOutlookMsg
.To = sTo
.CC = sCC
.Subject = sSubject
.Body = sBody
'.HTMLBody = sBody
If Not IsMissing(sFilePath) And Len(sFilePath) > 0 Then .Attachments.add (sFilePath)
.Display 'Show mail
End With
'Cleanup:
Set objOutlookMsg = Nothing
Set objOutlook = Nothing
This was working fine.
Recently we changed to another mailserver. Previously we used a POP-account but now we use an IMAP-account (Kerio Mailserver). We connect using the Kerio Outlook Connector.
Since that change my code doesn't work anymore.
The message is still created. The body, subject and To are correct. Even the attachment is correct, but when I send the message (using the sendbutton on the Outlook mail window) Outlook hangs and the message isn't send.
When I 'manually' create the message with the same body, subject, To and attachment all goes well.
Can anybody help me? I'm getting realy deperate.
Thanks
Paul
The Netherlands