-1

I am trying to send a basic confirmation email after a user submits my html form using the php mail() function, but for some reason the email won't send. Here is my code:

<?php
echo "You're all set! You should be recieving a confirmation email within the next few minutes.";

$to = $_POST["email"];
$subject = "Your Appointment";
$msg = "Your appointment has been scheduled for " . $_POST["ApptDate"] . ".";

mail($to,$subject,$msg);
?>

I know my form is working correctly, because I am taken to this page after I submit the form. Also, "email" and "ApptDate" are keys I stored in my html form, and when I echo the variables they all print, so I don't think its a variable related error. Any help would be greatly appreciated.

Nate
  • 54
  • 8

1 Answers1

0

is it localhost? or a server?

You would need an SMTP server setup in either case,

For localhost i use this one as its a one-click-never-touch-again setup https://toolheap.com/test-mail-server-tool/users-manual.html

Raheel Hasan
  • 5,753
  • 4
  • 39
  • 70