Wrox Home  
Search P2P Archive for: Go

  Return to Index  

asp_cdo thread: How do I get the mail adress from exchange 5.5?


Message #1 by Robbin Gille <robbin.gille@n...> on Fri, 8 Mar 2002 12:11:48 +0100
I have a exampel that gets the name from our exhange 5.5 server from 

the

login name. But I want to get the email-adress. How do I do that?



This code gets the name from exhange. Maybe It's only one more line 

thats

needed?



	'------------------------------

	'Tar fram namnet p=E5 personen fr=E5n mail-servern, fr=E5n

inloggningsnammnet t.ex. rog blir Robbin Gille

	Dim oConn, oRS, GreetName



	'Create ADO connection and set its properties

	Set oConn =3D Server.CreateObject("ADODB.Connection")

	oConn.Provider =3D "ADsDSOOBJECT"

	oConn.Properties("Encrypt Password") =3D False

	'oConnOpen "ADs Provider"

	oConn.Open "Active Directory Provider"

	Set oRS =3D oConn.Execute("<LDAP://mailservern IP>;(uid=3D" & 

LoginName

& "); adspath,cn;subtree")

		If oRS.BOF OR oRS.EOF Then

			GreetName =3D ""

		Else

			GreetName =3D oRS.Fields("cn").Value

		End If

	oRS.Close

	oConn.Close

	Set oRS =3D Nothing

	Set oConn =3D Nothing

=09

//Robbin

Message #2 by "Siegfried Weber" <sweber@c...> on Mon, 11 Mar 2002 18:23:05 +0100
I believe the LDAP property of the Exchange 5.5 Directory to retrieve 

this setting via ADSI is "Mail-Drop".



<Siegfried />



> -----Original Message-----

> From: Robbin Gille [mailto:robbin.gille@n...]

> Sent: Friday, March 08, 2002 12:12 PM

> To: ASP CDO

> Subject: [asp_cdo] How do I get the mail adress from exchange 5.5?

>

> I have a exampel that gets the name from our exhange 5.5 server from 

the

> login name. But I want to get the email-adress. How do I do that?

>

> This code gets the name from exhange. Maybe It's only one more line 

thats

> needed?

>

> 	'------------------------------

> 	'Tar fram namnet p=E5 personen fr=E5n mail-servern, fr=E5n

> inloggningsnammnet t.ex. rog blir Robbin Gille

> 	Dim oConn, oRS, GreetName

>

> 	'Create ADO connection and set its properties

> 	Set oConn =3D Server.CreateObject("ADODB.Connection")

> 	oConn.Provider =3D "ADsDSOOBJECT"

> 	oConn.Properties("Encrypt Password") =3D False

> 	'oConnOpen "ADs Provider"

> 	oConn.Open "Active Directory Provider"

> 	Set oRS =3D oConn.Execute("<LDAP://mailservern IP>;(uid=3D" & 

LoginName

> & "); adspath,cn;subtree")

> 		If oRS.BOF OR oRS.EOF Then

> 			GreetName =3D ""

> 		Else

> 			GreetName =3D oRS.Fields("cn").Value

> 		End If

> 	oRS.Close

> 	oConn.Close

> 	Set oRS =3D Nothing

> 	Set oConn =3D Nothing

>

> //Robbin

>




$subst('Email.Unsub').


  Return to Index