Accessing Internet Mail Profile in Outlook 2003

  • Thread starter Thread starter Scott Brown
  • Start date Start date
S

Scott Brown

Hello,
I am trying to figure out how to access the settings for Internet Mail
in Outlook 2003. In OL 2000 and 2002, I was able to access that info
in the registry. It appears MS no longer stores this info in the
registry in OL 2003. I have Outlook Redemption and I tried to access
the data with the ProfMan.dll that comes with it, but wasn't able to
figure out how to do that.
I got as far as getting VB to display the name of my Internet Mail
profile, but couldn't figure out how to display the email address and
the name that is displayed when I send emails out. I also want to get
the SMTP mail server name, SMTP mail server login ID, and the
Organization Name. Basically I want my application to be able to
detect the user's mail settings. I'm pasting the code I am working
with below. The inner most loop (with the "ci" variable) doesn't
work... Either I have the wrong CDO constants for the info I'm trying
to retrive or I'm just going about this in the wrong way. I'd
appreciate any ideas anyone might have. Thanks a lot!

Scott Brown



Set Profiles = CreateObject("ProfMan.Profiles")
For i = 1 To Profiles.Count
Set Profile = Profiles.Item(i)
Set Services = Profile.Services
Debug.Print "------ " & Profile.Name & " ------"
For j = 1 To Services.Count
If Services.Item(j).servicename = "IMAIL" Then
Debug.Print Services.Item(j).servicename & "*"
Debug.Print "DisplayName - " &
Services.Item(j).profsect.Item(&H3001001E)
'Debug.Print "Email Addr - " &
Services.Item(j).profsect.Item(&H3003001E)
For ci = 1 To Services.Item(j).providers.Count
Debug.Print ci & " - " &
Services.Item(j).providers.Item(ci).displayname
Debug.Print ci & " DisplayName - " &
Services.Item(j).profsect.Item(&H3001001E)
Debug.Print ci & " Email Addr - " &
Services.Item(j).profsect.Item(&H3003001E)
Debug.Print ci & " Server - " &
Services.Item(j).profsect.Item(&H660C001E)
Next
Else
'Debug.Print Services.Item(j).ServiceName
End If
Next
Next
 
IMAIL service is not MAPI based and it cannot be accessed using Extended
MAPI (or ProfMan). Supposedly there is an Account Manager API, but it has
never been documented by MS.

Dmitry Streblechenko (MVP)
http://www.dimastr.com/
OutlookSpy - Outlook, CDO
and MAPI Developer Tool
 
Back
Top