G
Gayathrie Gunawardene
When I tried to debug a program written using VB, which intend to send an
email attachment, I get the following error message.
Error -2147024891 : [Collaboration Data Objects - [ E_ACCESSDENIED
(80070005)]]
The email attachment is getting saved in the Outbox of Microsoft Outlook
thus not allowing the user to select the recipient list from TO, CC & BCC
lists. Some parts of the codes are stated below for your information
...........
..............
Set objSession = CreateObject("Mapi.Session")
...........
..............
objSession.Logon "MS Exchange Settings", , False, False
'// The CurrentUser status of the objSession changes from
""<[Collaboration Data '// Objects - [ MAPI_E_NOT_INITIALIZED
(80040605)]]> " to "<[Collaboration '// Data Objects -
['//E_ACCESSDENIED (80070005)]]> "
...........
..............
Set objMessage = objSession.Outbox.Messages.Add
...........
..............
With objMessage
.Subject = m_Subject
.Text = m_Message
For Each AttachmentName In m_Attachments
Set objAttach = .Attachments.Add
With objAttach
.Type = mapiFileData
.Position = 1
.Source = ""
.Name = AttachmentName
.ReadFromFile AttachmentName
End With
Next AttachmentName
.Update
End With
...........
..............
For Each MAPIName In m_TOList
Set objOneRecip = objMessage.Recipients.Add
objOneRecip.Name = MAPIName
objOneRecip.Type = mapiTo
objOneRecip.Resolve
Next MAPIName
...........
..............
objMessage.Send showDialog:=WithDialog '// This is where the error is
thrown
objSession.Logoff
...........
..............
ErrorHandler:
If Err Then
MsgBox "Error " & Str$(Err) & ": " & Error$(Err)
End If
I use Windows XP, Outlook 2002 sp2 and CDO 1.21. Could this Access denial
error is caused due to some email configuration settings? Has anyone done
any investigation into this earlier?
Please explain why the MAPI session object gives an error of access denial.
What are the options that I can try to resolve this problem?
Thanks,
Gayathrie
email attachment, I get the following error message.
Error -2147024891 : [Collaboration Data Objects - [ E_ACCESSDENIED
(80070005)]]
The email attachment is getting saved in the Outbox of Microsoft Outlook
thus not allowing the user to select the recipient list from TO, CC & BCC
lists. Some parts of the codes are stated below for your information
...........
..............
Set objSession = CreateObject("Mapi.Session")
...........
..............
objSession.Logon "MS Exchange Settings", , False, False
'// The CurrentUser status of the objSession changes from
""<[Collaboration Data '// Objects - [ MAPI_E_NOT_INITIALIZED
(80040605)]]> " to "<[Collaboration '// Data Objects -
['//E_ACCESSDENIED (80070005)]]> "
...........
..............
Set objMessage = objSession.Outbox.Messages.Add
...........
..............
With objMessage
.Subject = m_Subject
.Text = m_Message
For Each AttachmentName In m_Attachments
Set objAttach = .Attachments.Add
With objAttach
.Type = mapiFileData
.Position = 1
.Source = ""
.Name = AttachmentName
.ReadFromFile AttachmentName
End With
Next AttachmentName
.Update
End With
...........
..............
For Each MAPIName In m_TOList
Set objOneRecip = objMessage.Recipients.Add
objOneRecip.Name = MAPIName
objOneRecip.Type = mapiTo
objOneRecip.Resolve
Next MAPIName
...........
..............
objMessage.Send showDialog:=WithDialog '// This is where the error is
thrown
objSession.Logoff
...........
..............
ErrorHandler:
If Err Then
MsgBox "Error " & Str$(Err) & ": " & Error$(Err)
End If
I use Windows XP, Outlook 2002 sp2 and CDO 1.21. Could this Access denial
error is caused due to some email configuration settings? Has anyone done
any investigation into this earlier?
Please explain why the MAPI session object gives an error of access denial.
What are the options that I can try to resolve this problem?
Thanks,
Gayathrie