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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 20, 20262026-05-20T01:47:24+00:00 2026-05-20T01:47:24+00:00

I have a very simple contact form on my site, Im looking for users

  • 0

I have a very simple contact form on my site, Im looking for users to be able to just put a check mark next to “CC:” to have it CC them without creating a whole new field for that they have to fill out again.

Here is the HTML:

<form action="send.php" method="post" name="form1">
Name: <input name="name" size="35"><br/>
E-mail:<input name="email" size="35"><br/>
CC: <input input type="checkbox" name="mailcc"><br/>
Comment: <textarea cols="35" name="comment" rows="5"></textarea> <br />
<input name="Submit" type="submit" value="Submit">
</form>

And here is the PHP:

<?php
$name = $_REQUEST['name'] ;
$email = $_REQUEST['email'] ;
$comment = $_REQUEST['comment'] ;

mail( "me@me.com", "Message Title",  "Name:  $name\n Email:  $email\n Comments: $comment\n " );

echo "Message Sent! Thanks!"

?>

Ive been trying to add some items from this site:

http://w3mentor.com/learn/php-mysql-tutorials/php-email/send-email-with-cccarbon-copy-bccblind-carbon-copy/

But it wants to create a text field for CC which means the user would have to enter their email twice.

Ive also tried $mailheader.= "Cc: " . $email ."\n"; but I cant get that to work either.

  • 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-05-20T01:47:25+00:00Added an answer on May 20, 2026 at 1:47 am
    1. Make the checkbox have a value (value="1") in HTML.
    2. Add a variable ($mailheader) to the end of mail() function, as the last parameter.

    So essentially:

    $name = $_POST['name'] ;
    $email = $_POST['email'] ;
    $comment = $_POST['comment'] ;
    
    if ($_POST['mailcc'] == 1) {
        $mailheader .= "CC: $name <$email>";
    }
    
    mail("me@me.com", "Message Title", "Name:  $name\n Email:  $email\n Comments: $comment\n ", $mailheader);
    
    echo "Message Sent! Thanks!";
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a very simple contact form with fields like this: <label> First Name<em>*</em>
I have very simple contact form and I would like to hide the label
I have a very simple Mac Cocoa app that just has a Web View
I am trying to build a very simple Contact browser. I have a Collection
I have a very simple form.I want to insert the form data in mysql
I have a very simple model form, but for some reason, the code fails
If I have a very simple http directory: default.html info.html contact.html etc... Should default.html
I have a very simple wcf server. When a client uses an operation contract,
I have very simple window where I have 2 buttons - one for cancel,
I have a very simple webforms app that will allow field techs to order

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.