473,386 Members | 1,705 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

Get Microsoft Exchange Server Name

I've added the ability to send e-mails from MyApp using CDO. I would
like to programatically get the name of the Microsoft Exchange Server.

How do I do that?

Thanks.

Mar 7 '07 #1
2 2955
rdemyan wrote:
I've added the ability to send e-mails from MyApp using CDO. I would
like to programatically get the name of the Microsoft Exchange Server.
Perhaps this works for you:

http://support.microsoft.com/kb/183917
--
'---------------
'John Mishefske
'---------------
Mar 8 '07 #2
John, thanks for the reply, but the code requires that an Exchange
Server be set.

I found the following which might do the trick (my apologies for not
noting where I got this code):
________________________________________
Public Sub GetCDOParameters()

Dim strEnterprise As String, strSite As String, strServer As String
Dim strProfileInfo As String
Dim objRenderApp As Object

' Create renderer application
On Error Resume Next
Set objRenderApp = Server.CreateObject("AMHTML.Application")

' Pull configuration out of the registry
Err.Clear
On Error Resume Next
objRenderApp.LoadConfiguration 1, _
"HKEY_LOCAL_MACHINE\System\CurrentControlSet\Servi ces\MSExchangeWeb
\Parameters"

strEnterprise = objRenderApp.ConfigParameter("Enterprise")
strSite = objRenderApp.ConfigParameter("Site")
strServer = objRenderApp.ConfigParameter("Server")

' Construct CDO profile
strProfileInfo = "/o=" + strEnterprise + "/ou=" + strSite + _
"/cn=Configuration/cn=Servers/cn=" + strServer + vbLf + "anon" + vbLf
+ "anon"

' Create CDO session
Err.Clear
On Error Resume Next
Set objSession = Server.CreateObject("MAPI.Session")

' Logon with anonymous CDO profile
Err.Clear
On Error Resume Next
objSession.Logon "", "", False, True, 0, True, strProfileInfo
End Sub
________________________________________
I'm not even sure if I need all of this. Seems like strServer is what
I want. But I'm getting an error on:

Set objRenderApp = Server.CreateObject("AMHTML.Application")

on the Server word. I do have a reference to Microsoft CDO1.21 Library
set.

Any help is appreciated.
On Mar 7, 9:42 pm, John Mishefske <jmishefsk...@SPAMyahoo.comwrote:
rdemyanwrote:
I've added the ability to send e-mails from MyApp using CDO. I would
like to programatically get the name of the Microsoft Exchange Server.

Perhaps this works for you:

http://support.microsoft.com/kb/183917

--
'---------------
'John Mishefske
'---------------

Mar 9 '07 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Arun T M | last post by:
I have a Windows Service written in VB .NET which connects to an Exchange Server and accesses the messages in the Public Folders. I am using Collaborative Data Objects to do this. When I run the...
1
by: Ginters | last post by:
I'm not asking a lot. I just want to know if I can connect from an Exchange server to a SQl server without having to use Access linked tables. Surely MS must have had a look at this but I can't...
2
by: M Rao | last post by:
I have xml data coming in as a stream from a web service running against exchange server.The attributes for the elements dtstart and dtend, b:dt="dateTime.tz"...
2
by: James | last post by:
Is it possible for me to generate Outlook objects in an ASP.NET application on a web server (like a calander event for example) and then attach that object to an email so that the recipient can...
0
by: wazoo | last post by:
We've written a number of VB/ASP.Net intranet webapps that allow our users to email various electronic versions of formerly paper forms to their supervisors. Currently, we're using a rather simple...
8
by: Jim in Arizona | last post by:
I was trying to have an email sent when the page loads but having some trouble with it. Our server is an IIS 6.0 with Framework 2.0. It is set to windows authentication (not anonymous). I...
0
by: Alan | last post by:
Hello World: I'm trying to build an application (using Access 2003) that will allow users who have to perform tasks in a particular order, to notify the next person in line when their task is...
9
by: Paul H | last post by:
If there is no email client on the XP workstation that my DB is on, is it possible for Access to talk directly with Exchange Server to send an email? I am sure you might think, what's the problem...
0
by: =?Utf-8?B?YXVsZGg=?= | last post by:
hello i need some assistance on how to start on this project. i was given a very large wish list to collect from and Exchange environment. Exchange name LDAP server name Exchange IP address...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.