3
I have a PHP file on a website that receives via POST the return sent by Pagseguro on purchases made on the site -- client name, amount paid, e-mail... finally, all the information regarding the purchase.
In this file I have a script that sends to the customer’s email a message about the purchase, using the data sent by Pagseguro.
In this script I have a line where I get a hidden copy of the message:
$headers .= "Bcc: [email protected]\r\n";
I always got the message, but I noticed that, for a few days now, I haven’t received anything, and I even thought that no sale was being made, but the sales are taking place normally.
The code is this:
$headers = "MIME-Version: 1.1\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1\r\n";
$headers .= "From: [email protected]\r\n"; // remetente
$headers .= "Bcc: [email protected]\r\n";
$headers .= "Return-Path: [email protected]\r\n"; // return-path
mail($CliEmail, "Cupom Ticiana Werner Restaurante - ".$codCupom, $corpo, $headers);
All variables are correct. I have already done a test changing the $CliEmail
by my email "[email protected]" and the message usually arrives in my mailbox, IE, no mistake happens.
The problem seems to be on the line that sends the hidden copy as I get nothing:
$headers .= "Bcc: [email protected]\r\n";
Any idea what it might be? Because I always received this hidden copy before and now nothing.
UPDATING:
I changed the "Bcc" to "Cc" and received the copy normally! The problem is the "Bcc" that no longer works.
If you stopped sending without the code being changed, the problem must be on the send/receive server. Check for updates/settings performed on the mail server and PHP.
– Gabriel Heming
@Gabrielheming Yeah, the code hasn’t been moved, it’s still the same. It just stopped sending the hidden copy. Weird that. Only if they changed something on the server and this Bcc no longer works.
– Sam