此脚本的目的是发送一封电子邮件,但它不会包含您的姓名和电子邮件,而是将其包含在消息中,因为该网站已经从 PHP 会话中获得了有关此内容的详细信息。目前“2Email”工作..它可以向收件人的邮箱发送消息,并包含用户输入的消息。但它不遵循模板。IE 它不包括文本“通过仪表板发送”
<?php
session_start();
if(!isset($_SESSION["USER"])){
header("Location: ../login.php?NotAuth");
}
$to = $_POST['2Email'];
$name = $_SESSION["USER"]["FullName"];
$email = $_SESSION["USER"]["Email"];
$subject = $_POST['regarding'];
$message = $_POST['msg'];
$Cc= $_SESSION["USER"]["Email"];
$headers = "From: $email";
$tracker = "This message was sent via the TrackerSystem dashboard";
$message = "Hi, "."\n".$message. "\n". "Regards, ".$name. "\n".$tracker.
$sent = mail($to, $subject, $message, $headers) ;
if($sent) {
print "Sent successfully! XD ";
} else {
print "The server made a booboo, the email didn't send :'( ";
}
?>