Message-Id header master
Message-Id header

--- a/class.mailer.php
+++ b/class.mailer.php
@@ -5,6 +5,7 @@
  *
  * Sends MIME emails, TXT/HTML/Attachments
  *
+ * @date        2009-08-03
  * @category    Mail
  * @package     Mailer
  * @author      Razvan Stanga <git@razvi.ro>
@@ -34,6 +35,7 @@
 	private $to;
 	private $replyto;
 	private $returnpath;
+	private $messageid;
 
 	private static $instance = array ();
 	public $IB		= false;
@@ -109,6 +111,10 @@
 
 	public function setReturnPath ($email) {
 		$this->returnpath = $email;
+	}
+
+	public function setMessageId ($messageid) {
+		$this->messageid = "<".$messageid."@".$this->smtp_host.">";
 	}
 
 	public function setCharset ($charset) {
@@ -251,7 +257,10 @@
 		$headers .= "From: ".$this->from."\r\n";
 		$headers .= "Reply-To: ".$this->replyto."\r\n";
 		$headers .= "Sender: ".$this->sender."\r\n";
-		$headers .= "X-Mailer: razvi.ro/svn/mailer\r\n";
+		$headers .= "X-Mailer: http://git.razvi.ro/?p=mailer.git\r\n";
+		if ( $this->messageid ) {
+			$headers .= "Message-Id: ".$this->messageid."\r\n";
+		}
 		if ( $this->smtp_host ) {
 			$headers .= "To: ".$this->to."\r\n";
 			$headers .= "Subject: ".$this->subject."\r\n";

comments