【问题标题】:How to send email using XAMMP如何使用 XAMPP 发送电子邮件
【发布时间】:2014-02-08 07:07:47
【问题描述】:

这是我在 php 中发送电子邮件的代码:

<?php
    $to = 'xyz@xyz.com';
    $subject = 'Customer_Details Report';
    $msg="some message";

    if($result)
    {
        echo 'your email has been sent';
    }
    else
    {
        echo'email not sent';
    }
?>

如何在 XAMPP 中设置水星来发送邮件。

【问题讨论】:

    标签: php email mercury-mta


    【解决方案1】:

    首先你需要正确配置php.inisendmail.ini文件。

    sendmail.ini 文件应包含

    first smtp_server=mail.gmail.com ,
    second smtp_port=465 (if not worked try 587),
    third auth_username= xxx@gmail.com auth_password=yourpassword
    

    在此之后重新启动您的服务器。

    【讨论】:

      猜你喜欢
      • 2013-03-13
      • 2012-05-07
      • 2015-08-11
      • 2021-09-12
      • 2013-03-30
      • 2016-07-29
      • 2018-10-16
      相关资源
      最近更新 更多