-1

I Cant send Mail From Localhost. I Use Xampp And My php.ini And sendmail.ini File Are Proper Configured

What Can I Do Now?

Vao Tsun
  • 37,644
  • 8
  • 70
  • 98
Hannan
  • 9
  • 1

2 Answers2

1

You cannot send mail from localhost using mail function. you have to use SMTP in order to send email.

Check this for how to use SMTP to send email.

Community
  • 1
  • 1
Kamran
  • 2,631
  • 2
  • 14
  • 24
1

If you only need to test your mail function without being connected to the internet, you should use Papercut, this simple application to test send mail. You don't need to configure anything.

Just run it and try test send mail.

sendmail.php

<?php
     $to = "sampleperson@example.com";
     $subject = "My Subject";
     $txt = "My sample msg.";
     $headers = "From: webmaster@example.com" . "\r\n" .
     "CC: somebodyelse@example.com";

     mail($to,$subject,$txt,$headers);
?>

You will get this. Papercut Inbox

Download Papercut here