Send a copy of the form to the company and to the customer

Asked

Viewed 22 times

0

Hello!
I have a problem sending a form.
When submitting, the completed data is sent to my email.
However, I would like a copy to be sent to the completed email on the form.
I have tried some codes but do not send to the filled email.
This is part of my code:

$nome = $_POST['nome'];
$emaill = $_POST['email'];

$to = "[email protected]";

$boundary = "XYZ-".md5(date("dmYis"))."-ZYX";

$headers = "MIME-Version: 1.0" . PHP_EOL;
$headers .= "Content-Type: multipart/mixed; ";
$headers .= "boundary=" . $boundary . PHP_EOL;
$headers .= "$boundary" . PHP_EOL;


if(mail($to, $assunto, $mens, $headers)){

One of the codes I tried to add

$headers .= "Cc: $emaill" . PHP_EOL;

But it didn’t work.

Can someone help me understand what I’m doing wrong?

Thank you very much!

1 answer

0

Browser other questions tagged

You are not signed in. Login or sign up in order to post.