Margarida Posted October 23, 2020 Share Posted October 23, 2020 I am wondering how to add a code to automatically send a copy as conformation to the sender. I need this code to send a exact copy to sender's email. I would appratite very much if someone can help. $nome = $_POST['nome']; $emaill = $_POST['email']; $to = "mail@mail.pt"; $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)){ I tried add $headers .= "Cc: $emaill" . PHP_EOL; But don't work. Can you help me? Quote Link to comment https://forums.phpfreaks.com/topic/311631-send-email-copy-to-client/ Share on other sites More sharing options...
gw1500se Posted October 23, 2020 Share Posted October 23, 2020 Where did you add that line? It probably need to be before they other headers. However, you are much better off using PHPMailer. It is easier to use and provides better control. Quote Link to comment https://forums.phpfreaks.com/topic/311631-send-email-copy-to-client/#findComment-1582015 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.