I'm using the following to send registration e-mails:
$subject = 'subject is here';
$message_raw = 'e-mail text';
$message = base64_encode($message_raw);
$headers = 'MIME-Version: 1.0' . "\r\n";
$headers .= 'Content-type: text/plain; charset=UTF-8' . "\r\n";
$headers .= 'Content-Transfer-Encoding: base64' . "\r\n";
$headers .= 'From: papa.sk <[email protected]>' . "\r\n";
$sendit = mail($to, $subject, $message, $headers);
For some people the e-mails are put into the spam folder (in gmail too).
In /etc/postfix/main.cf I have this:
myorigin = /etc/mailname
smtpd_banner = papa1.vps.websupport.sk ESMTP
Not sure whether I should change the above.
from @papa.sk
. What does your mail server's IP reverse-lookup as? if it comes back asxyz.somehost.org
, that's a major spam flag. Look at setting up domain keys/sender ID for your server. – Thready