Active Messaging Error '000004f9'.
hi all,
i face some problem when i want to send an email to some people by using the codes below. I'm using exhange server and CDO 1.1 and the server is windows server 2003. The codes are:
<%
CONST strMailServer = "rhythm_exc"
Dim objSession
Dim objAddrEntries
Dim objAddressEntry
Dim objFilter
Dim strMailbox
Dim strProfileInfo
Dim objNewMessage
Dim objRecipient
Function LogonMailServer()
strLogonID = Request.ServerVariables("Logon_User")
strMailbox = Right(strLogonID, Len(strLogonID) - InStr(strLogonID, "\"))
strProfileInfo = strMailServer & vbLf & strMailbox
set objSession = server.createobject("MAPI.Session")
objSession.Logon "","",False,True,,True,strProfileInfo
if err.number = 0 then
LogonMailServer = True
else
err.clear
LogonMailServer = False
end if
End Function
Sub AddMessage(amSubject, amBody)
set objNewMessage = objSession.Outbox.Messages.Add
objNewMessage.Subject = cstr(amSubject)
objNewMessage.Text = cstr(amBody)
objNewMessage.Update
End Sub
Sub AddRecipient(arEmail, arType)
set objRecipient = objNewMessage.Recipients.Add
objRecipient.Name = arEmail
If arType = "CC" Then
objRecipient.Type = 2
Else
objRecipient.Type = 1
End If
On Error Resume Next
objRecipient.Resolve
If Err.Number = 0 Then
objNewMessage.Update
Else
Response.Write "<BR>Email address - " & arEmail & ", cannot be resolved/found in Global Exchange List." & vbCrLf
objRecipient.Delete
Set objRecipient = Nothing
Err.Clear
End If
End Sub
Sub SendMail()
err.clear
on error resume next
objNewMessage.Send
if err.number <> 0 then
response.write "An error has occured while sending email. Please contact system support for assistant.<BR>"
response.write err.number & " " & err.description & "<BR>[" & err.source & "]" & "<BR><BR>"
end if
End Sub
Sub GetGlobalAddressBook()
set objAddrEntries = objSession.AddressLists("Global Address List").AddressEntries
End Sub
Sub LogOffMailServer()
objSession.Logoff
set objFilter = nothing
set objAddrEntries = nothing
set objSession = nothing
End Sub
%>
the parameters are passed from other page. however, when i try to execute the codes, there is an error ocured.
Error:
Active Messaging Error '000004f9' The information could not be opened. [MAPI 1.0 - [MAPI_E_LOGON_FAILED(80040111)]]
the error is occured at line highlighted in red color.
Please help me to resolve the problem.
Thanks to all.
|