UtterAccess.com
X   Site Message
(Message will auto close in 2 seconds)

Welcome Guest ( Log In | Register )

 
Reply to this topicStart new topic
> CDO: Send password when logging into mailbox    
 
   
JeremyWilson
post Apr 10 2009, 04:45 PM
Post #1

UtterAccess Member
Posts: 35
From: Atlanta, GA



I'm relatively new to using CDO. Previously I have used it to send SMTP messages from Access, but now I'm trying to use it to connect to an Exchange Server mailbox and read emails. I downloaded the CDO 1.21 help file for a reference.

I am able to successfully log on to a session using this code:

CODE
Set objSession = CreateObject("MAPI.Session")
strPROFILE = "my_server_name" & vbLf & "some_mailbox"
objSession.Logon , , False, , , , strPROFILE


However, when I try to retrieve anything from the mailbox, asks for a domain user and password for someone with permissions for some_mailbox.

My question is, does anybody know how to pass the NT user password for "some_mailbox" when logging in to the session? I have tried the following syntaxes and all come up with login errors.

CODE
strPROFILE = "my_server_name" & vbLf & "some_mailbox"
strPROFILE = "my_server_name" & vbLf & "some_mailbox""some_password"
strPROFILE = "my_server_name" & vbLf & "some_mailbox" & vblf & "some_password"
Go to the top of the page
 
+
vtd
post Apr 10 2009, 06:18 PM
Post #2

Retired Moderator
Posts: 19,667



Have you tried using the first 2 arguments (ProfileName and ProfilePassword) instead of the last argument ProfileInfo?

According the book "CDO & MAPI Programming with Visual Basic" by Dave Grundgeiger, the ProfileInfo argument is used mainly as a temporary profile (and the session can even be anonymous).
Go to the top of the page
 
+
JeremyWilson
post Apr 13 2009, 09:08 AM
Post #3

UtterAccess Member
Posts: 35
From: Atlanta, GA



Yeah. Those arguments are to use an existing Mail profile that you have created in the control panel. It uses the connection info in that profile to connect to exchange. If you already have a session going (you have Outlook open), then you don't have to specify a profile.

I tried the mailbox name and password in the profile name and password arguments and got this error:

[Collaboration Data Objects - [MAPI_E_LOGON_FAILED(80040111)]]

The more that I look into it, I think that I need to make sure that all users of the db have domain permissions to use the mailbox. I will let everyone know what I find out.

Thanks,
Jeremy
Go to the top of the page
 
+
vtd
post Apr 13 2009, 03:40 PM
Post #4

Retired Moderator
Posts: 19,667



I am pretty sure the ProfileName argument wants the MAPI Profile name and not the MailBox Alias.

Cheers
Go to the top of the page
 
+
JeremyWilson
post Apr 13 2009, 04:50 PM
Post #5

UtterAccess Member
Posts: 35
From: Atlanta, GA



FYI, we just created a group in Active Directory for the db users and gave that group permission to the mailbox in exchange. No more prompts!
Go to the top of the page
 
+
vtd
post Apr 13 2009, 08:26 PM
Post #6

Retired Moderator
Posts: 19,667



Thanks for posting back your solution, Jeremy.

Cheers
Go to the top of the page
 
+

Thank you for your support! Reply to this topicStart new topic

Jump To Forum:
 



RSS Go to Top  ·  Lo-Fi Version Time is now: 18th June 2013 - 02:12 AM