B
bobdydd
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:
QUOTE
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
cdosession.Logon
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
cdorecipient.Resolve
cdomessage.Send showdialog:=False
SendAnEmail = True
Set cdorecipient = Nothing
Set cdomessage = Nothing
cdosession.Logoff
Set cdosession = Nothing
DoEvents
End Function
UNQUOTE
I am working on Windows 2000, Windows XP, VB6, Outlook 2000, and Access
2000.
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?
Regards
Bob Dydd
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:
QUOTE
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
cdosession.Logon
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
cdorecipient.Resolve
cdomessage.Send showdialog:=False
SendAnEmail = True
Set cdorecipient = Nothing
Set cdomessage = Nothing
cdosession.Logoff
Set cdosession = Nothing
DoEvents
End Function
UNQUOTE
I am working on Windows 2000, Windows XP, VB6, Outlook 2000, and Access
2000.
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?
Regards
Bob Dydd