I have cross-origin request from client side to the PHP Api. I founded that at the response request part some cookies couldn’t be able set on the client side.
At the PHP Api side i have code:
require($_SERVER["DOCUMENT_ROOT"]."/bitrix/modules/main/include/prolog_before.php");
$names = ClearTextData($_POST['names']);
$to = "some";
$subject = "some";
$message = "some";
$headers = "some";
$emailResult = mail($to, $subject, $message, implode("rn", $headers), " [email protected]");
sometimes mail() PHP function didn’t work. Could bad context of not settings headers influence on the mail() PHP function?
When i’ve changed to same-origin request everything working. mail() function work.
whats wrong with the mail() function on the cross-origin request?