Вопрос

Here is my code in php to send email:

<?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';
    }
?>

How do I set up mercury in XAMPP to send the mail.

Это было полезно?

Решение

First you need to configure the php.ini and sendmail.ini files correctly.

The sendmail.ini file should contain

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

after this restart your server.

Лицензировано под: CC-BY-SA с атрибуция
Не связан с StackOverflow
scroll top