Using email form with DB calling multiple emails

I am in a little over my head here, so proceed with caution!

I am trying to incorporate a new, more secure email form into a website that has uses a single form, but has multiple recipients (depending on the customer page that they are viewing). This is a db (mysql/php) driven site.

Currently, the new form config calls for something very simple like this for a single user email, single page form:

$email    =  <!-- e --><a href="mailto:[email protected]">[email protected]</a><!-- e -->;       // Your email

$reply_email   = "[email protected]";   // Reply email

The way my current email form pulls the correct emails from the DB is: $email = $dbs[‘user_email’]

I can get the form to send a copy to whatever email I submit into the form, and the form submits. But there is never an email that shows up when I use the following: $emailto = “dbs[‘user_email’]”;

I can tell you that the form is pulled into the page with the following: <?php include_once("gbcf-v3/form.php"); ?>

There are then a set of variables that are called from another page that looks like this:
if(file_exists(‘files/functions.php’)) {
require_once(“files/functions.php”);
} else if(file_exists(’’.$set_directory.’/files/functions.php’)) {
require_once("$set_directory/files/functions.php");
} else if(file_exists(’…/’.$set_directory.’/files/functions.php’)) {
require_once("…/$set_directory/files/functions.php");
} else if(file_exists(’…/…/’.$set_directory.’/files/functions.php’)) {
require_once("…/…/$set_directory/files/functions.php");
} else if(file_exists(’…/…/…/’.$set_directory.’/files/functions.php’)) {
require_once("…/…/…/$set_directory/files/functions.php");
} else if(file_exists(’…/…/…/…/’.$set_directory.’/files/functions.php’)) {
require_once("…/…/…/…/$set_directory/files/functions.php");

I am thinking that I need a line in the above code that hits my config file that connects the form with the DB and then pulls the correct email. Beacuse up to this point, there is no connection with the email form and the DB when viewing the page.

Not sure if any of this makes sense. If it does, and you can help, then you will take a load off my mind this morning.

Thanks for your time!

Have you tried Debugging (see my signature)? I’m pretty sure that if your email doesn’t send, then your $emailto variable is empty (or contains incorrect data). Try echoing out all variables that you’re using in your mail() function, right before you call mail().

Sponsor our Newsletter | Privacy Policy | Terms of Service