0

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.

Gábor Bakos
  • 8,982
  • 52
  • 35
  • 52
Dev_FullStack
  • 33
  • 1
  • 8

1 Answers1

0

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.

nico
  • 50,859
  • 17
  • 87
  • 112
Ferrakkem Bhuiyan
  • 2,741
  • 2
  • 22
  • 38