Check Box CC email issue

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
coopera
Forum Newbie
Posts: 1
Joined: Fri Sep 21, 2007 6:58 pm

Check Box CC email issue

Post by coopera »

feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]


Hi I am trying to create a form that has a check box for send me a copy, i have created the below it sends the support resquest but does not CC the person requesting the support.

php code:

Code: Select all

$email= valid_email($_POST['email']);
$toEmail = "xxxx@xxxx.com.au";
$username= $_POST['username'];
$question= $_POST['question'];
$priority= $_POST['priority'];
$headers = 'From: enquiries@xxxx.com.au' . "\r\n";
$headers .= 'Reply-To:' . $email . "\r\n";
$headers .= 'X-Mailer: PHP/' . phpversion();
// if they want to be CC'd
if(isset($_POST['copyMe']))
{
$headers .= 'Cc:' . $email . "\r\n";
}
$subject = "MIS Support";
$message = "Name: $username


<input type="checkbox" name="copyMe" value="checkbox" />
<em>Send a copy to my email</em></label></p>
Can someone please help.

thanks in advance.


feyd | Please use

Code: Select all

,

Code: Select all

and [syntax="..."] tags where appropriate when posting code. Your post has been edited to reflect how we'd like it posted. Please read:  [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url] to learn how to do it too.[/color]
User avatar
yacahuma
Forum Regular
Posts: 870
Joined: Sun Jul 01, 2007 7:11 am

use phpmailer or swiftmailer

Post by yacahuma »

use phpmailer or swiftmailer it will be a lot easier.
Post Reply