Install Postfix:
- sudo apt-get install postfix
- Choose satellite system
- Choose example.com for the system mail name (it will mean the 'hidden' Return-Path address goes to nothing, not the visible From/Reply-to address)
- Type your ISP's SMTP address
- Type a user for incoming email
- Just accept the defaults for other questions
To check the version, do postconf -d | grep mail_version
PHP/XAMPP settings:
- In php.ini, add: sendmail_path = /usr/sbin/sendmail -t
$email = 'you@yourdomain.com';
$headers = "From: $email\r\n";
$headers .= "Reply-To: $email\r\n";
$subject = "test subject";
$message = "test body";
print mail($email,$subject,$message,$headers) . "\n";
?>