Wrox Programmer Forums
|
ASP CDO As of Oct 5, 2005, this forum is now locked. No posts have been deleted. Please use "Classic ASP Professional" at: http://p2p.wrox.com/forum.asp?FORUM_ID=56 for discussions similar to the old ASP Pro Code Clinic or one of the other many remaining ASP and ASP.NET forums here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP CDO section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old August 8th, 2005, 07:48 PM
Registered User
 
Join Date: Jul 2005
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.






Similar Threads
Thread Thread Starter Forum Replies Last Post
instant messaging with System.Messaging connect2sandep General .NET 35 March 1st, 2006 01:11 PM
Date-Time Picker Active-X Error Loralee Access 2 January 30th, 2006 08:22 PM
error authenticating to active directory planeswalk ASP.NET 1.0 and 1.1 Professional 2 June 2nd, 2005 02:49 AM
Active list box and button error messages - Help! dbkester Access 2 August 28th, 2003 02:55 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.