Archive for the ‘ Mail server ’ Category

PHP emailing script

This is a tested script for correctly sending emails via php:

<?php
$to      = '[email protected]';
$subject = 'This is the subject';
$message = 'Hello! this is the bottom text';
$headers = 'Content-type: text/html; charset="UTF-8"' . "\r\n" .
'From: [email protected]' . "\r\n" .
'Reply-To: [email protected]' . "\r\n" .
'X-Mailer: PHP/' . phpversion();
mail($to, $subject, $message, $headers,"[email protected]");
?>

Postfix doesn’t start after a re-install

Perhaps this might be the solution. Check if there are the necessary sendmail files below.
If you do not have /usr/sbin/sendmail, check if after installing postfix package, you have:

/usr/sbin/sendmail.postfix

If you do, simply make a symlink:

ln -s /usr/sbin/sendmail.postfix /usr/sbin/sendmail