Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8044181
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T05:08:42+00:00 2026-06-05T05:08:42+00:00

I have a simple contact form on my website that sends an email to

  • 0

I have a simple contact form on my website that sends an email to different email addresses (different physical offices and email accounts) DEPENDING on which checkboxes the user fills out.

There are two checkboxes, one NMB and one MB for the values.

Here is what I want to do:
If one checkbox (NMB) is checked, send email to addy1
If one checkbox (MB) is checked, send to email addy2
If BOTH checkboxes (NMB and MB) is checked, send email to BOTH

SO, so far, I have this, but I suspect that its not going to work, or will send multiple emails….

    $office  = $_POST['office'];

    if  ($office == "NMB" ){
        $address = "adyy1@narf.com";
    }
    elseif  ($office == "MB" ){
        $address = "adyy2@narf.com";
    }
    elseif  ($office == "NMB"  && $office == "MB" ){
        $address = "addy1@narf.com,addy2@narf.com";
    }

I feel I am close, but without a cigar. Thanks in advance for the help!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T05:08:44+00:00Added an answer on June 5, 2026 at 5:08 am

    This should work, but I am not sure what the names are for your checkboxes. You can replace cb1 and cb2 with the respective checkbox names.

    if  ($_POST['cb1'] == "NMB"  && $_POST['cb2']=='MB'){
        $address = "addy1@narf.com,addy2@narf.com";
    }else if($_POST['cb1']=="NMB"){
        $address = "adyy1@narf.com";
    }else if($_POST['cb2'] == "MB" ){
        $address = "adyy2@narf.com";
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a simple contact form on a website that has 2 text fields,
I have a simple contact form with Subject and Message that I want to
i have a simple contact us form and i need to send an email
I have a simple contact form which uses jquery to post to a php
I have a simple jQuery script that slides a contact form up from the
I am new to PHP, but, I have a simple contact form that is
I have a website, and in the Contact section I have a form which
i have developed a simple php contact form, that's working fine, but i am
I have a tooltip with a simple contact form that I want to load
I have a simple contact form with name, email, a select list, and textarea.

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.