如何使用邮件功能配置 smtp 设置 smtp 是必需的,因为由于安全原因,Web 托管不允许在没有 smtp 设置的情况下发送电子邮件。
warning error: mail() has been disabled for security reasons
现在如何使用此邮件功能()配置 smtp 设置?
<?php
if(isset($_REQUEST['confirm'])){
$your_email = 'non-reply@test.com'; //CHANGE TO YOUR SETTINGS
$domain = $_SERVER["HTTP_HOST"]; //YOUR DOMAIN AND EXTENSION
$to = $email;
$subject = 'Demo Your Order';
$message = 'test1234';
$headers .= 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=iso-8859-1' . "\r\n";
$headers .= "From: Demo.Pk<'.$your_email.'@'.$domain.'>\r\n" .
//"Reply-To: $from \r\n" .
"X-Mailer: PHP/" . phpversion();
mail($to, $subject, $message, $headers);
}
?>