Trying to set-up a simple email script. Every customer must have a login with an email address. If a potential client wants to email that user, I don't want their email posted where others can see it.

So my question is how to I query an email address from the database to load into the to: example@example.com in the sendmail script???


If this makes no sense I'll understand :)

Member Avatar for diafol

Keep the user's id in dropdown option value - or hidden field - whatever you're using to pass the id of the user. So the mailform passes this id to your formhandler script, the script gets the email address from the db that relates to the user id. Well, that;s pretty much it, you just use mail() or an equivalent then to send the details.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.