문제

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