0

So i have designed a PHP email system following some tutorials and was does it work? I've installed XAMPP and named the index (Index.php) so that the php should work, when when testing it on Localhost it doesn't send what's in the field 'email' like it should be doing. Any help/advice please.

<?php
if(!empty($_POST["email"])) {
 if(checkEmail(strip_tags(trim($_POST['email'])))) {
  $to = 'freemanstreetwifi@gmail.com';
  $msg = strip_tags(trim($_POST['email']));
  if(!($mail = mail($to, $msg, "Wifi Email", $msg))) {
   echo "<center> Email Failed </center>";
  }
 } else {
   echo "<center> Email Failed </center>";
  }
}
?>
Kilyosen
  • 23
  • 6
  • Just your script? Can you send mails from other scripts? Is your PHP mail setup correctly? Also, make sure you use TWO DIFFERENT status messages, yours currently both say it failed. :) –  Feb 05 '15 at 11:17
  • Have you check your SMTP configuration... ? – Debflav Feb 05 '15 at 11:18
  • running windows or linux? is sendmail or any other app installed? also change the first echo "" to email sent – peterpeterson Feb 05 '15 at 11:22
  • This is all i have, I don't have any SMTP configuration, would i need SMTP config for this to work? Running Windows XP, when installing XAMPP sendmail was installed if that helps. – Kilyosen Feb 05 '15 at 11:31

0 Answers0