The following code snippet is not working.
I checked my php.ini
file, but it looks fine.
It's not returning any errors.
I have heard something about using something called sendmail
.
I am using a Mac.
What am I doing wrong?
<form action="" method="post">
<button class="btn" type="submit" name="submit" value="submit">CLICK</button>
</form>
<?php
if(isset($_POST['submit'])) {
error_reporting();
$to = 'philipnagel511@gmail.com';
$subject = 'subject';
$message = 'text';
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/html; charset=windows-1251' . "\r\n";
$headers .= 'To: user <philipnagel511@gmail.com>' . "\r\n";
$headers .= 'From: server <nipdeliveries@gmail.com>' . "\r\n";
mail($to, $subject, $message, $headers);
}
?>