Я пытаюсь отправить электронное письмо с помощью функции php email(), но я новичок в php, поэтому я привел два html-файла вместе, чтобы включить переменные php, которые я видел в качестве переменных ввода, таких как $ a = 2; то {{2}} в html, как это работает?Как поместить переменные php в электронные письма?
В настоящее время я делаю то, что работает.
$to =$currentEmail;
$subject = 'An Excercise on math4cxc.com has just been completed!';
$headers = "From: [email protected]\r\n";
$headers .= "Reply-To: [email protected]\r\n";
$headers .= "MIME-Version: 1.0 \r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1 \r\n";
$message='Hello '
.$currentUser.' ,'.$message;//$currentuser declared previously
$message="<html><head></head><body><i>".$message."</i></body></html>";
$file = file_get_contents('../email/index.htm', FILE_USE_INCLUDE_PATH);
$file2 = file_get_contents('../email/index2.html', FILE_USE_INCLUDE_PATH);
$message=$file.$message.$file2; //brought together as if one file
$to.=',[email protected]';
mail($to,$subject,$message,$headers);
Итак, что на самом деле не работает? –