The Design of Software (CLOSED)

A public forum for discussing the design of software, from the user interface to the code architecture. Now closed.

The "Design of Software" discussion group has been merged with the main Joel on Software discussion group.

The archives will remain online indefinitely.

VB6 and MAPI help needed

Hi Everybody

Can anyone help with this mindbender

We are writing an application that uses a VB built DLL to send emails
using CDO 1.21.

Whether we use the VB DLL or code the CDO stuff direct into Access
makes no difference.

The problem is that when an email has been sent, the next JUMP (End of
function/return/New Routine/Error Handler) causes a crash.

The Code:

Private Function SendAnEmail(addr As String, subj As String, body As
String)As Boolean

Dim cdosession      As MAPI.Session
Dim cdofolder      As MAPI.Folder

Dim cdomessages    As MAPI.Messages
Dim cdomessage      As MAPI.Message
Dim cdorecipient    As MAPI.Recipient

    Set cdosession = New MAPI.Session

    SendAnEmail = False
    MsgBox cdosession.Version

    Set cdomessage = cdosession.Outbox.Messages.Add

    cdomessage.Subject = subj
    cdomessage.Text = body
    cdomessage.Importance = CdoHigh
    Set cdorecipient = cdomessage.Recipients.Add
    cdorecipient.Name = addr
    cdorecipient.Type = CdoTo
    cdomessage.Send showdialog:=False

    SendAnEmail = True

    Set cdorecipient = Nothing
    Set cdomessage = Nothing
    Set cdosession = Nothing

End Function

I am working on Windows 2000, Windows XP, VB6, Outlook 2000, and Access

This function needs to be distributed to the world to work on any
machine and operating system (All Windows versions) and any MAPI
compliant email client.

Can anyone Help?


jeffrey lewis Send private email
Wednesday, June 01, 2005
If you are using CDO 1.21 it is only going to be compatiable with Exchange and Outlook configurations.  You might look into using CDO for Windows 2000 (CDOSYS).

As far as the Access error goes I can't really help there.
Wednesday, June 01, 2005
check into Revelation for Outlook - much easier to deal with.
Bob Walsh Send private email
Thursday, June 02, 2005

This topic is archived. No further replies will be accepted.

Other recent topics Other recent topics
Powered by FogBugz