EDITED:
I have a contact form using HTML/PHP. I would like users to be able to select a department from a dropdown menu, and have the email sent to just that department's email address.
My question is: Where in the PHP do I specify what email address the information is sent to based on the users dropdown selection. I'm assuming it's from this portion of the code:
HTML
<label class="custom-select">
<select name="department">
<option>Technical Issues</option>
<option>Charities</option>
<option>General Inquiries</option>
<option>Other</option>
</select><span><!-- fake select handler --></span>
</label>
</div>
<div class="column-100">
<textarea name="message" placeholder="Type your message here..."></textarea>
</div>
<div class="column-100 center">
<input type="submit" value="Send" data-error="Fix errors" data-processing="Sending..." data-success="Thank you!">
</div>
<footer class="notification-box"></footer>
</form>
</div>
PHP
define('FROM_EMAIL', '');
// Recipient's e-mail. To this e-mail messages will be sent.
// e.g.: [email protected]
// multiple recipients e.g.: [email protected], [email protected]
define('TO_EMAIL', '[email protected]');
/**
* Function for sending messages. Checks input fields, prepares message and sends it.
*/
function sendMessage() {
// Variables init
Thanks in advance. :)