1

I've got PHP working on High Sierra on OS X.

I'd like to use it to send an email. (Using this for Secret Santa program.) The mail function doesn't seem to actually anything, though.

<?php
  $to      = 'exampleperson@gmail.com';
  $subject = 'the subject';
  $message = 'hello';
  $headers = 'From: secretsanta@exampledomain.com' . "\r\n" .
    'Reply-To: secretsanta@exampledomain.com' . "\r\n" .
    'X-Mailer: PHP/' . phpversion();
  mail($to, $subject, $message, $headers);
?>

Am I missing a configuration somewhere?

Skeptic
  • 115
  • 5
  • Email uses a separate server. Most local web server software doesn't have any installed. It's a huge PIA to do this. – ShoeLace1291 Nov 24 '17 at 23:43
  • 1
    Configure an SMTP server and send it via SMTP. Otherwise your mails won't reach any modern mail provider. – Mr.Moe Nov 24 '17 at 23:47
  • This is going to be a nightmare do to anti-spam measures. It's best to use a mail provider these days. – Brad Nov 24 '17 at 23:56

0 Answers0