Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Trouble accessing email inbox using ASP

Status
Not open for further replies.

roadcone20

Programmer
Jan 5, 2004
16
0
0
US
Hey, first time poster here. I have a question about a script I'm trying to write in ASP. Basically at this point all I want to do is access the inbox of an email account. I wrote this script and it works when "email name" (in the code below) is set to my own email, but it gives me this error when I change it to the account that I want to access:

Error Type:
Collaboration Data Objects (0x4F7)
[Collaboration Data Objects - [MAPI_E_NOT_FOUND(8004010F)]]


I figured it would be permissions on the email account, but I have full access to it. Any ideas?

Thanks a lot. The script follows:

<%

bstrServer = &quot;amt-exc3&quot;
bstrMailbox = &quot;email name&quot;
bstrProfileInfo = bstrServer + vbLF + bstrMailbox

'CreateObject MAPI.Session
Set objSession = Server.CreateObject(&quot;MAPI.Session&quot;)

objSession.Logon &quot;&quot;, &quot;&quot;, False, True, 0, True, bstrProfileInfo

Set objFolder = objSession.Inbox
Response.write objFolder.Name

Set objMessages = objFolder.Messages
For Each objMessage In objMessages
Response.Write objMessage.Subject & &quot;<br>&quot;
'Response.Write objMessage.Subject & &quot;:&quot; & objMessage.Text & &quot;<br>&quot;
Next
%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top