Как вставить переменные $phone и $quantity в письмо?
<?php
$quantity = $_POST['quantity'];
$phone = $_POST['phone'];
$mainprice = $_POST['mainprice'];
$quantity = htmlspecialchars($quantity);
$phone = htmlspecialchars($phone);
$mainprice = htmlspecialchars($mainprice);
$quantity = urldecode($quantity);
$phone = urldecode($phone);
$mainprice = urldecode($mainprice);
$quantity = trim($quantity);
$phone = trim($phone);
$mainprice = trim($mainprice);
$to = 'example@yandex.ru';
$subject = "Send HTML Email Using PHP";
$htmlContent = '
<html>
<body>
<h1>Получена заявка с сайта! :)</h1>
<p>Номер телефона: </p>
<p>Количество: </p>
</body>
</html>';
// Set content-type header for sending HTML email
$headers = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type:text/html;charset=UTF-8" . "\r\n";
// Additional headers
$headers .= 'From: Samwan<info@codexworld.com>' . "\r\n";
$headers .= 'Cc: welcome@example.com' . "\r\n";
$headers .= 'Bcc: welcome2@example.com' . "\r\n";
// Send email
if(mail($to,$subject,$htmlContent,$headers)):
header("Location: /thankyou");
else:
header("Location: /thankyou");
endif;
?>