Commits

Eric Barnes committed b08b27e

Changed email library to allow setting different user-agent. Fixes #286

Comments (0)

Files changed (2)

system/libraries/Email.php

 	 */
 	function initialize($config = array())
 	{
-		$this->clear();
 		foreach ($config as $key => $val)
 		{
 			if (isset($this->$key))
 				}
 			}
 		}
+		$this->clear();
 
 		$this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE;
 		$this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE;
 			$this->_attach_type = array();
 			$this->_attach_disp = array();
 		}
-		
+
 		return $this;
 	}
 
 
 		$this->_set_header('From', $name.' <'.$from.'>');
 		$this->_set_header('Return-Path', '<'.$from.'>');
-		
+
 		return $this;
 	}
 
 			case 'mail'		: $this->_recipients = implode(", ", $to);
 			break;
 		}
-		
+
 		return $this;
 	}
 
 		{
 			$this->_cc_array = $cc;
 		}
-		
+
 		return $this;
 	}
 
 		{
 			$this->_set_header('Bcc', implode(", ", $bcc));
 		}
-		
+
 		return $this;
 	}
 
 		}
 
 		$this->newline	= $newline;
-		
+
 		return $this;
 	}
 
 		}
 
 		$this->crlf	= $crlf;
-		
+
 		return $this;
 	}
 
 				{
 					$this->_finalbody = $hdr . $this->newline . $this->newline . $this->_body;
 				}
-				
+
 				return;
 
 			break;
 					$body .= "Content-Type: text/html; charset=" . $this->charset . $this->newline;
 					$body .= "Content-Transfer-Encoding: quoted-printable" . $this->newline . $this->newline;
 				}
-				
+
 				$this->_finalbody = $body . $this->_prep_quoted_printable($this->_body) . $this->newline . $this->newline;
-				
-				
+
+
 				if ($this->_get_protocol() == 'mail')
 				{
 					$this->_header_str .= $hdr;
 				if ($this->_get_protocol() == 'mail')
 				{
 					$this->_header_str .= $hdr;
-				}				
-				
+				}
+
 				$body .= $this->_get_mime_message() . $this->newline . $this->newline;
 				$body .= "--" . $this->_atc_boundary . $this->newline;
 
 			case 'html-attach' :
 
 				$hdr .= "Content-Type: multipart/".$this->multipart."; boundary=\"" . $this->_atc_boundary."\"" . $this->newline . $this->newline;
-				
+
 				if ($this->_get_protocol() == 'mail')
 				{
 					$this->_header_str .= $hdr;
 		}
 
 		$body .= implode($this->newline, $attachment).$this->newline."--".$this->_atc_boundary."--";
-		
+
 
 		if ($this->_get_protocol() == 'mail')
 		{
 		{
 			$this->_finalbody = $hdr . $body;
 		}
-		
+
 		return;
 	}
 
 		{
 			// most documentation of sendmail using the "-f" flag lacks a space after it, however
 			// we've encountered servers that seem to require it to be in place.
-						
+
 			if ( ! mail($this->_recipients, $this->_subject, $this->_finalbody, $this->_header_str, "-f ".$this->clean_email($this->_headers['From'])))
 			{
 				return FALSE;
 		fputs($fp, $this->_finalbody);
 
 		$status = pclose($fp);
-	
+
 		if (version_compare(PHP_VERSION, '4.2.3') == -1)
 		{
 			$status = $status >> 8 & 0xFF;

user_guide/changelog.html

 
 <h3>Bug fixes for 2.0.0</h3>
 <ul>
+	<li>Fixed a bug where you could not change the User-Agent when sending email.</li>
 	<li>Fixed a bug where the Output class would send incorrect cached output for controllers implementing their own <dfn>_output()</dfn> method.</li>
 	<li>Fixed a bug where a failed query would not have a saved query execution time causing errors in the Profiler</li>
 	<li>Fixed a bug that was writing log entries when multiple identical helpers and plugins were loaded.</li>
 		</ul>
 	</li>
 
-	
+
 	<li>Documentation Changes
 		<ul>
 			<li>Added <a href="./doc_style/index.html">Writing Documentation</a> section for the community to use in writing their own documentation.</li>