getting mail address out of ldap

NLMA - March 22, 2007 - 15:16
Project:LDAP integration
Version:HEAD
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:closed
Description

Hi folks,
I hope I posted this question in the right 'Project' and such.

Here's my trouble:
I have this php page that does all kinds of stuff such as sending mails out and such. I'm not a code wonder and I didn't create this page, nor can I go and trace down the original creator.

somewhere in the code I need to send a mail to a specific email address. The way it works now is that that mail is simply mailed to the person that is logged into drupal. His mail is quite readily available.

What I want it to do however is go and get an other mail out of the AD by use of a query.
I have the name of the user that needs to receive the mail as a '$wie' variable in the code. So is there a query string that allows me to quickly get that users email address out of the AD?

preferable by use of the already existing link to the AD via the LDAP module.

Help on this really is appreciated!
Thx

#1

NLMA - March 22, 2007 - 15:42

perhaps I should ellaborate a bit more... So here's some code:

you'll see that the $to_aanvrager variable gets the mail of the person that has logged in. That's what I don't want.
I want this $to_aanvrager to contain the mail that I should find via the query I'm looking for to get the name out of the LDAP.
I have the full name of the person in a variable called $wie

so I need to set $to_aanvrager= LDAP query with '$wie' that gives me the mail corresponding with the name in the variable '&wie';

here is the code snippet:

if($mailtoaanvrager!="")
                                {
                                $to_aanvrager=$custom_user_mail;
                                $subject="de opdracht zal uitgevoerd worden door $fotograaf";
                                if($to_aanvrager!="")
                                        {
                                        $message2 = "<html>".$message.get_address($fotograaf)."<br>(de aanvraag werd bewerkt door ".$custom_user_name.")"."</html>";
                                        mail_dm($to_aanvrager,$mailsender,$envelopesender,$subject,$message2);
                                        echo "<br>uw aanpassing werd ook verzonden naar ".$to_aanvrager;
                                        }
                                }

#2

scafmac - April 17, 2007 - 02:58
Status:active» closed

Sorry for the delay.

I believe you would have less overhead to just create your own node. This module does not allow querying of other user's ldap records. It is primarily for allowing authentication against and ldap server. Some side modules allow for users' attributes to be imported into profiles fields after a successful login, but that is pretty different than what I believe you are trying to do.

Good luck.

 
 

Drupal is a registered trademark of Dries Buytaert.