【问题标题】:How to send an email by php and xampp localhost?如何通过 php 和 xampp localhost 发送电子邮件?
【发布时间】:2019-09-16 22:39:47
【问题描述】:

我的服务器端文件有问题

我试图发送一封电子邮件,但我没有在邮箱中找到任何东西

<?
$from = 'faresbenslama95@gmail.com';
$to_email = 'faresbenslama95@gmail.com';
$subject = 'Testing PHP Mail';
$message = 'This mail is sent using the PHP mail function';
$headers  = "MIME-Version: 1.0" . "\r\n";
$headers .= "Content-type: text/html; charset=iso-8859-1" . "\r\n";
$headers .= "From: " . $from . "\r\n";
$headers .= "Reply-To: " . $from . "\r\n";
$headers .= "X-Mailer: PHP/" . phpversion();
$headers .= "X-Priority: 1" . "\r\n";
mail('faresbenslama95@gmail.com', $subject, $message, $headers);
?>

我希望收到电子邮件,但没有收到消息。

【问题讨论】:

    标签: xampp php-7


    【解决方案1】:

    您是否错过了开头提出的 php 或只是显示示例。代码看起来不错

    【讨论】:

      猜你喜欢
      • 2014-08-28
      • 2014-06-25
      • 2012-07-03
      • 1970-01-01
      • 1970-01-01
      • 2018-03-08
      • 2012-05-07
      • 2016-05-13
      • 2017-01-25
      相关资源
      最近更新 更多