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 8796911
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T23:43:52+00:00 2026-06-13T23:43:52+00:00

I have a contact form in my website. I need users to send messages

  • 0

I have a contact form in my website. I need users to send messages to my email, and it does so. I also have a checkbox, which when checked, the users will have the message to the email indicated on the email textbox. My code sends it only to my email, but it doesn’t send a copy when the checkbox is checked.

Contact.html

<input type="checkbox" name="sendcopy" value="Yes" checked/>Copy this message to your mail

Sendmail.php:

$messagebody="Name: ".$name."".PHP_EOL;
$messagebody.="email: ".$email."".PHP_EOL;
$messagebody.="website: ".$website."".PHP_EOL;
$messagebody.="message: ".nl2br($message)."".PHP_EOL;

mail($to,$subject,$messagebody,$headers)or die("The message failed to send");  

if(isset($_POST["sendcopy"]) && $_POST["sendcopy"]=="checked"){
mail($email,$subject,$messagebody,$headers)or die("The message failed to send a copy") 
    }
  • 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-13T23:43:54+00:00Added an answer on June 13, 2026 at 11:43 pm

    In the snippet if(isset($_POST["sendcopy"]) && $_POST["sendcopy"]=="checked"){ value of $_POST["sendcopy"] you are trying to match with is wrong.
    Instead, you can use just if(isset($_POST["sendcopy"]){ to check if that checkbox is checked.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a contact form on my website so users can send me an
I have a contact form which asks users for their name, email address and
On my client's website (domain.com) we have a contact form which sends an email
i have one contact form, when user submit all value will send(email) to admin.But
I have a contact form on my website, which actually works :D The problem
I have a contact form on a website (a general form: name , email
I have always used this code to send email from contact form of websites
I have a website with a contact form. User submits name, email and message
I have form on my website which is contact form. I am using ReCaptcha
I have a contact form made with php on my website. The problem is

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.