How to add a CC: to mail.php |
How to add a CC: to mail.php |
larry78723 |
Mar 22 2020, 08:29 AM
Post
#1
|
Member Group: Members Posts: 39 Joined: 5-March 20 Member No.: 27,220 |
The following code works well but I'd like to add a cc: to $email. I think, but not sure, that I'll have to create an array[] to contain $recipient and $email and I don't know how to include the array[] in the "mail($recipient, $subject, $formcontent, $mailheader)". Can someone help me out on this?
CODE <?php $subject = $_POST['type']; $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; $formcontent=" From: $name \n Message: $message"; if ($subject =="Website Problem") { $recipient="webmaster@foxclone.com"; } else{ $recipient="andyh@foxclone.com"; } $mailheader = "From: $email \r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("Error!"); echo "Thank You!" . " -" . "<a href='index3.php' style='text-decoration:none;color:#ff0099;'> Return Home</a>"; ?> Thanks in advance, Larry |
larry78723 |
Mar 22 2020, 01:25 PM
Post
#2
|
Member Group: Members Posts: 39 Joined: 5-March 20 Member No.: 27,220 |
Got it working like this:
<?php $subject = $_POST['type']; $name = $_POST['name']; $email = $_POST['email']; $message = $_POST['message']; $formcontent=" From: $name \n Message: $message"; if ($subject =="Website Problem") { $recipient="webmaster@foxclone.com"; } else{ $recipient="andyh@foxclone.com"; } $mailheader = "From: $email\r\nBcc: $email\r\n"; mail($recipient, $subject, $formcontent, $mailheader) or die("Error!"); echo "Thank You!" . " -" . "<a href='index3.php' style='text-decoration:none;color:#ff0099;'> Return Home</a>"; ?> |
larry78723 |
Mar 22 2020, 01:26 PM
Post
#3
|
Member Group: Members Posts: 39 Joined: 5-March 20 Member No.: 27,220 |
Was duplicate post. Sorry!
This post has been edited by larry78723: Mar 22 2020, 01:31 PM |
Lo-Fi Version | Time is now: 25th September 2024 - 01:48 PM |