我想使用 Sendinblue 交易电子邮件在 php 中发送电子邮件。问题是我需要在我的电子邮件中添加 php 变量,但是在我收到它之后,php 变量并没有变成文本!
这是我收到的:
https://drive.google.com/file/d/1--c84eZcSJpp9icfsNZeXxj048Y-d3f9/view?usp=drivesdk
这是我的 php 代码:
<?php
// Check for empty fields
if(empty($_POST['name']) || empty($_POST['email']) || empty($_POST['phone']) || empty($_POST['message']) || !filter_var($_POST['email'], FILTER_VALIDATE_EMAIL)) {
http_response_code(500);
exit();
}
$name = strip_tags(htmlspecialchars($_POST['name']));
$email = strip_tags(htmlspecialchars($_POST['email']));
$phone = strip_tags(htmlspecialchars($_POST['phone']));
$message = strip_tags(htmlspecialchars($_POST['message']));
// Create the email and send the message
$subject = "HMP Reseller - New Message";
$body = "You have received a new message from HMP Reseller contact form.\n\n"."Here are the details:\n\nName: $name\n\nEmail: $email\n\nPhone: $phone\n\nMessage:\n$message";
include 'Mailin.php';
$mailin = new Mailin('hosteymega@gmail.com', 'API-KEY');
$mailin->
addTo('hosteymega@gmail.com', 'HosteyMega Hosting')->
setFrom('admin@hosteyme.ga', 'HosteyMega Admin')->
setReplyTo('$email','HMP Reseller Client')->
setSubject('$subject')->
setText('$body')->
setHtml('<h2>$body</h2>');
$res = $mailin->send();
/**
Successful send message will be returned in this format:
{'result' => true, 'message' => 'Email sent'}
*/
?>
有什么办法可以解决吗?