Skip to content

Instantly share code, notes, and snippets.

@bantya
Last active February 10, 2019 20:12
Show Gist options
  • Save bantya/19da1685f105197d09adca2d02bfbba3 to your computer and use it in GitHub Desktop.
Save bantya/19da1685f105197d09adca2d02bfbba3 to your computer and use it in GitHub Desktop.
PHP: Mail headers
<?php
$headers = [
'MIME-Version: 1.0',
'Content-Type: text/html; charset="UTF-8";',
'Content-Transfer-Encoding: 7bit',
'Content-Disposition: inline',
'Date: ' . date('r', $_SERVER['REQUEST_TIME']),
'Message-ID: <' . $_SERVER['REQUEST_TIME'] . md5($_SERVER['REQUEST_TIME']) . '@' . $_SERVER['SERVER_NAME'] . '>',
'From: ' . $from,
'Reply-To: ' . $from,
'Return-Path: ' . $from,
'X-Mailer: PHP v' . phpversion(),
'X-Originating-IP: ' . $_SERVER['SERVER_ADDR'],
'X-Priority: 1 (Higuest)',
'X-MSMail-Priority: High',
'Importance: High',
'Sensitivity: Personal',
];
// Sensitivity: Normal, Personal, Private and Company-Confidential
// These will be recognised and handled in Outlook, Thunderbird and others.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment