|
From: Ulf E. <ulf...@us...> - 2005-08-22 20:54:52
|
Update of /cvsroot/phpbt/phpbt/inc/htmlMimeMail In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv23647/phpbt/inc/htmlMimeMail Modified Files: htmlMimeMail.php smtp.php Log Message: Added support to set envelope sender Index: htmlMimeMail.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/htmlMimeMail/htmlMimeMail.php,v retrieving revision 1.3 retrieving revision 1.4 diff -u -r1.3 -r1.4 --- htmlMimeMail.php 5 Dec 2004 16:36:14 -0000 1.3 +++ htmlMimeMail.php 22 Aug 2005 20:54:43 -0000 1.4 @@ -1,774 +1,776 @@ -<?php -/** -* Filename.......: class.html.mime.mail.inc -* Project........: HTML Mime mail class -* Last Modified..: Date: 2002/07/24 13:14:10 -* CVS Revision...: Revision: 1.4 -* Copyright......: 2001, 2002 Richard Heyes -*/ - -require_once(dirname(__FILE__) . '/mimePart.php'); - [...1519 lines suppressed...] + + if (!$this->is_built) { + $this->buildMessage(); + } + + // Return path ? + if (isset($this->return_path)) { + $headers[] = 'Return-Path: ' . $this->return_path; + } + + // Get flat representation of headers + foreach ($this->headers as $name => $value) { + $headers[] = $name . ': ' . $value; + } + $headers[] = 'To: ' . implode(', ', $recipients); + + return implode(CRLF, $headers) . CRLF . CRLF . $this->output; + } +} // End of class. +?> Index: smtp.php =================================================================== RCS file: /cvsroot/phpbt/phpbt/inc/htmlMimeMail/smtp.php,v retrieving revision 1.2 retrieving revision 1.3 diff -u -r1.2 -r1.3 --- smtp.php 25 Oct 2004 12:07:05 -0000 1.2 +++ smtp.php 22 Aug 2005 20:54:43 -0000 1.3 @@ -26,6 +26,7 @@ var $auth; var $user; var $pass; + var $sender; /** * Constructor function. Arguments: @@ -57,6 +58,7 @@ $this->auth = FALSE; $this->user = ''; $this->pass = ''; + $this->sender = null; $this->errors = array(); foreach($params as $key => $value){ @@ -127,7 +129,10 @@ return FALSE; } - $this->mail($this->from); + $envelope_sender = $this->from; + if (!is_null($this->sender)) + $envelope_sender = $this->sender; + $this->mail($envelope_sender); if(is_array($this->recipients)) foreach($this->recipients as $value) $this->rcpt($value); |