# Checkbox to select email addresses

**URL:** <https://forum.kirupa.com/t/checkbox-to-select-email-addresses/283039>\
**Category:** programming\
**Created:** [March 1, 2009, 11:02pm UTC](https://forum.kirupa.com/t/checkbox-to-select-email-addresses/283039 "2009-03-01T23:02:50Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![njfuller](https://avatars.discourse-cdn.com/v4/letter/n/a3d4f5/32.png) [@njfuller](https://forum.kirupa.com/u/njfuller)\
**Post date:** [March 1, 2009, 11:02pm UTC](https://forum.kirupa.com/t/checkbox-to-select-email-addresses/283039/1 "2009-03-01T23:02:50Z")

</div>

Hi all,

Kirupa forums have rescued me in the past many many times, I’m hoping you guys can save me once again!

I have a simple contact form on my website, using html form + php to send the info. I would like to make a change to the form, but do not know how to do it. The change is fairly simple, instead of having the form sent automatically to "me@mycompany.com" I would like the user to be able to select via checkboxes whether they send the info to "me@mycompany.com" "you@yourcompany.com" or "us@ourcompany.com" - or if they like… all 3 🙂

I have played and played but have got utterly lost, the php script for the contact form is below, I have made no changes and it works fine as it is - but just emails "me@mycompany.com" - could anybody please please please let me know how to make these changes to allow 3 checkboxes to select who you email? I will be so grateful for any help

Thank you! :sen:

[COLOR=Red]\<?php  
$firstname = $\_POST[‘firstname’];  
$lastname = $\_POST[‘lastname’];  
$email = $\_POST[‘email’];  
$message = $\_POST[‘message’];

$emailmessage = “Name: {$firstname} {$lastname}, with an email address of: {$email}, has contacted mycompany with the following message: {$message}”;

$response = "Dear {$firstname},

Thank you for contacing mycompany, we have received your message and will respond within 24 hours.

Sincerely,

The Team";

mail($email, ‘Your message to Mycompany’,$response, "FROM:noreply@mycompany.com  
");  
mail(‘me@mycompany.com’, ‘Message sent to mycompany’, $emailmessage, “FROM:$email”);

?\>  
[/COLOR]
