CMS MADE SIMPLE FORGE

CMSMailer

 

[#1961] Add SSL/TLS support to SMTP mailer method

avatar
Created By: Robert Sherby (alpicola)
Date Submitted: 2007-12-09 16:00

Assigned To:
Resolution: Fixed
State: Closed
Summary:
Add SSL/TLS support to SMTP mailer method
Detailed Description:
An increasing number of SMTP hosts are requiring the use of SSL for sending
email.  Of particular interest to small businesses, Google Apps requires the use
of SSL.  The addition of SSL support to CMSMailer would make this module even
more useful as a general purpose mail API.  Adding SSL support can be
accomplished at very little increase in module complexity.

Drupal has confronted the same issue here: http://drupal.org/node/39138

The attached patch, written against CMSMailer 1.73.11, provides SSL/TLS
connection support.  The preferences user interface has also been modified to
add a radio box to select SSL, TLS, or unencrypted connection types.  I have
tested the functionality against smtp.gmail.com and it appears to work fine.

History

Comments
avatar
Date: 2008-09-08 13:39
Posted By: Dobes Vandermeer (dobesv)

I want this feature - lame that it's been sitting here for a year with a nice
patch that hasn't been integrated.

I tried to apply the patch to the latest CMSMS but the patch failed.  I don't
support you could put a new patch for the latest CMSMailer?


      
avatar
Date: 2008-09-16 13:32
Posted By: Ravith Botejue (ravithb)

The following patch which was generated by manually patching the 1.4.1 version
of cmsms keeping ssl.patch as a reference.

Index: CMSMailer/CMSMailer.module.php
===================================================================
--- CMSMailer/CMSMailer.module.php	(revision 41)
+++ CMSMailer/CMSMailer.module.php	(working copy)
@@ -28,837 +28,858 @@
 
 #-------------------------------------------------------------------------
 /* Your initial Class declaration. This file's name must
-   be "[class's name].module.php", or, in this case,
-   Skeleton.module.php
-*/ 
+ be "[class's name].module.php", or, in this case,
+ Skeleton.module.php
+ */
 class CMSMailer extends CMSModule
 {
-  var $the_mailer;
+	var $the_mailer;
 
-  /*---------------------------------------------------------
-   CMSMailer()
-   constructor
-   ---------------------------------------------------------
-  function CMSMailer()
-  {
-    // call the parent class' constructor
-    parent::CMSModule();
+	/*---------------------------------------------------------
+	 CMSMailer()
+	 constructor
+	 ---------------------------------------------------------
+	 function CMSMailer()
+	 {
+	 // call the parent class' constructor
+	 parent::CMSModule();
 
-    // now do our stuff
-    $this->the_mailer = NULL;
-  }
-  
+	 // now do our stuff
+	 $this->the_mailer = NULL;
+	 }
 
 
-  /*---------------------------------------------------------
-   GetName()
-   ---------------------------------------------------------*/
-  function GetName()
-  {
-    return 'CMSMailer';
-  }
 
+	 /*---------------------------------------------------------
+	 GetName()
+	 ---------------------------------------------------------*/
+	function GetName()
+	{
+		return 'CMSMailer';
+	}
 
-  /*---------------------------------------------------------
-   GetFriendlyName()
-   ---------------------------------------------------------*/
-  function GetFriendlyName()
-  {
-    return $this->Lang('friendlyname');
-  }
 
-	
-  /*---------------------------------------------------------
-   GetVersion()
-   ---------------------------------------------------------*/
-  function GetVersion()
-  {
-    return '1.73.14';
-  }
+	/*---------------------------------------------------------
+	 GetFriendlyName()
+	 ---------------------------------------------------------*/
+	function GetFriendlyName()
+	{
+		return $this->Lang('friendlyname');
+	}
 
 
-  /*---------------------------------------------------------
-   GetHelp()
-   ---------------------------------------------------------*/
-  function GetHelp()
-  {
-    return $this->Lang('help');
-  }
+	/*---------------------------------------------------------
+	 GetVersion()
+	 ---------------------------------------------------------*/
+	function GetVersion()
+	{
+		return '1.73.14';
+	}
 
-  
-  /*---------------------------------------------------------
-   GetAuthor()
-   ---------------------------------------------------------*/
-  function GetAuthor()
-  {
-    return 'Calguy1000';
-  }
 
+	/*---------------------------------------------------------
+	 GetHelp()
+	 ---------------------------------------------------------*/
+	function GetHelp()
+	{
+		return $this->Lang('help');
+	}
 
-  /*---------------------------------------------------------
-   GetAuthorEmail()
-   ---------------------------------------------------------*/
-  function GetAuthorEmail()
-  {
-    return 'calguy1000@hotmail.com';
-  }
 
-  
-  /*---------------------------------------------------------
-   GetChangeLog()
-   ---------------------------------------------------------*/
-  function GetChangeLog()
-  {
-    return $this->Lang('changelog');
-  }
+	/*---------------------------------------------------------
+	 GetAuthor()
+	 ---------------------------------------------------------*/
+	function GetAuthor()
+	{
+		return 'Calguy1000';
+	}
 
-  
-  /*---------------------------------------------------------
-   IsPluginModule()
-   ---------------------------------------------------------*/
-  function IsPluginModule()
-  {
-    return false;
-  }
 
+	/*---------------------------------------------------------
+	 GetAuthorEmail()
+	 ---------------------------------------------------------*/
+	function GetAuthorEmail()
+	{
+		return 'calguy1000@hotmail.com';
+	}
 
-  /*---------------------------------------------------------
-   HasAdmin()
-   ---------------------------------------------------------*/
-  function HasAdmin()
-  {
-    return true;
-  }
 
+	/*---------------------------------------------------------
+	 GetChangeLog()
+	 ---------------------------------------------------------*/
+	function GetChangeLog()
+	{
+		return $this->Lang('changelog');
+	}
 
-  /*---------------------------------------------------------
-   GetAdminSection()
-   ---------------------------------------------------------*/
-  function GetAdminSection()
-  {
-    return 'extensions';
-  }
 
+	/*---------------------------------------------------------
+	 IsPluginModule()
+	 ---------------------------------------------------------*/
+	function IsPluginModule()
+	{
+		return false;
+	}
 
-  /*---------------------------------------------------------
-   GetAdminDescription()
-   ---------------------------------------------------------*/
-  function GetAdminDescription()
-  {
-    return $this->Lang('moddescription');
-  }
-  
 
-  /*---------------------------------------------------------
-   VisibleToAdminUser()
-   ---------------------------------------------------------*/
-  function VisibleToAdminUser()
-  {
-    return $this->CheckPermission('Modify Site Preferences' );
-  }
+	/*---------------------------------------------------------
+	 HasAdmin()
+	 ---------------------------------------------------------*/
+	function HasAdmin()
+	{
+		return true;
+	}
 
-  /*---------------------------------------------------------
-   GetDependencies()
-   ---------------------------------------------------------*/
-  function GetDependencies()
-  {
-    return array();
-  }
-  
 
-  /*---------------------------------------------------------
-   Install()
-   ---------------------------------------------------------*/
-  function Install()
-  {
-    $this->SetPreference('mailer', 'smtp');
-    $this->SetPreference('host', 'localhost');
-    $this->SetPreference('port', 25 );
-    $this->SetPreference('from', 'root@localhost');
-    $this->SetPreference('fromuser', 'CMS Administrator');
-    $this->SetPreference('sendmail', '/usr/sbin/sendmail');
-    $this->SetPreference('timeout', 1000);
-    $this->SetPreference('smtpauth',0);
-    $this->SetPreference('username','');
-    $this->SetPreference('password','');
-  }
+	/*---------------------------------------------------------
+	 GetAdminSection()
+	 ---------------------------------------------------------*/
+	function GetAdminSection()
+	{
+		return 'extensions';
+	}
 
 
-  /*---------------------------------------------------------
-   InstallPostMessage()
-   ---------------------------------------------------------*/
-  function InstallPostMessage()
-  {
-    return $this->Lang('postinstall');
-  }
+	/*---------------------------------------------------------
+	 GetAdminDescription()
+	 ---------------------------------------------------------*/
+	function GetAdminDescription()
+	{
+		return $this->Lang('moddescription');
+	}
 
 
-  /*---------------------------------------------------------
-   UninstallPostMessage()
-   ---------------------------------------------------------*/
-  function UninstallPostMessage()
-  {
-    return $this->Lang('postuninstall');
-  }
+	/*---------------------------------------------------------
+	 VisibleToAdminUser()
+	 ---------------------------------------------------------*/
+	function VisibleToAdminUser()
+	{
+		return $this->CheckPermission('Modify Site Preferences' );
+	}
 
+	/*---------------------------------------------------------
+	 GetDependencies()
+	 ---------------------------------------------------------*/
+	function GetDependencies()
+	{
+		return array();
+	}
 
-  /*---------------------------------------------------------
-   Upgrade()
-   ---------------------------------------------------------*/
-  function Upgrade($oldversion, $newversion)
-  {
-    // nothing here
-  }
-	
-	
-  /*---------------------------------------------------------
-   Uninstall()
-   ---------------------------------------------------------*/
-  function Uninstall()
-  {
-    $this->RemovePreference('mailer');
-    $this->RemovePreference('host');
-    $this->RemovePreference('port');
-    $this->RemovePreference('from');
-    $this->RemovePreference('fromuser');
-    $this->RemovePreference('sendmail');
-    $this->RemovePreference('timeout');
-    $this->RemovePreference('smtpauth',0);
-    $this->RemovePreference('username');
-    $this->RemovePreference('password');
-  }
 
+	/*---------------------------------------------------------
+	 Install()
+	 ---------------------------------------------------------*/
+	function Install()
+	{
+		$this->SetPreference('mailer', 'smtp');
+		$this->SetPreference('host', 'localhost');
+		$this->SetPreference('port', 25 );
+		$this->SetPreference('protocol', '');
+		$this->SetPreference('from', 'root@localhost');
+		$this->SetPreference('fromuser', 'CMS Administrator');
+		$this->SetPreference('sendmail', '/usr/sbin/sendmail');
+		$this->SetPreference('timeout', 1000);
+		$this->SetPreference('smtpauth',0);
+		$this->SetPreference('username','');
+		$this->SetPreference('password','');
+	}
 
-  /*---------------------------------------------------------
-   DoAction($action, $id, $params, $return_id)
-   ---------------------------------------------------------*/
-  function DoAction($action, $id, $params, $returnid=-1)
-  {
-    global $gCms;
-    $smarty =& $gCms->GetSmarty();
-    $smarty->assign_by_ref('mod',$this);
 
-    switch ($action)
-      {
-      case 'default':
+	/*---------------------------------------------------------
+	 InstallPostMessage()
+	 ---------------------------------------------------------*/
+	function InstallPostMessage()
 	{
-	  break;
+		return $this->Lang('postinstall');
 	}
-      case 'setadminprefs':
+
+
+	/*---------------------------------------------------------
+	 UninstallPostMessage()
+	 ---------------------------------------------------------*/
+	function UninstallPostMessage()
 	{
-	  $this->_SetAdminPrefs( $id, $params, $returnid );
-	  break;
+		return $this->Lang('postuninstall');
 	}
-      default:
-	parent::DoAction($action,$id,$params,$returnid);
-      }
-  }
 
 
-  /*---------------------------------------------------------
-   DisplayErrorPage($id, $params, $return_id, $message)
-   NOT PART OF THE MODULE API
-   ---------------------------------------------------------*/
-  function _DisplayErrorPage($id, &$params, $returnid, $message='')
-  {
-    $this->smarty->assign('title_error', $this->Lang('error'));
-    if ($message != '')
-      {
-	$this->smarty->assign('message', $message);
-      }
-    
-    // Display the populated template
-    echo $this->ProcessTemplate('error.tpl');
-  }
+	/*---------------------------------------------------------
+	 Upgrade()
+	 ---------------------------------------------------------*/
+	function Upgrade($oldversion, $newversion)
+	{
+		// nothing here
+	}
 
-  //////////////////////////////////////////////////////////////////////
-  //// BEGIN API SECTION
-  //////////////////////////////////////////////////////////////////////
 
-  /*---------------------------------------------------------
-   reset()
-   NOT PART OF THE MODULE API
-   ---------------------------------------------------------*/
-  function reset()
-  {
-    $this->_load();
-    $this->the_mailer->Timeout = $this->GetPreference('timeout');
-    $this->the_mailer->Sendmail = $this->GetPreference('sendmail');
-    $this->the_mailer->Port   = $this->GetPreference('port');
-    $this->the_mailer->Mailer = $this->GetPreference('mailer');
-    $this->the_mailer->FromName = $this->GetPreference('fromuser');
-    $this->the_mailer->From = $this->GetPreference('from');
-    $this->the_mailer->Host = $this->GetPreference('host');
-    $this->the_mailer->SMTPAuth = $this->GetPreference('smtpauth');
-    $this->the_mailer->Username = $this->GetPreference('username');
-    $this->the_mailer->Password = $this->GetPreference('password');
-    $this->the_mailer->ClearAddresses();
-    $this->the_mailer->ClearAttachments();
-    $this->the_mailer->ClearCustomHeaders();
-    $this->the_mailer->ClearBCCs();
-    $this->the_mailer->ClearCCs();
-    $this->the_mailer->ClearReplyTos();
-    $charset = $this->GetPreference('charset');
-    if( !empty($charset) ) {
-      $this->SetCharSet($charset);
-    }
-  }
+	/*---------------------------------------------------------
+	 Uninstall()
+	 ---------------------------------------------------------*/
+	function Uninstall()
+	{
+		$this->RemovePreference('mailer');
+		$this->RemovePreference('host');
+		$this->RemovePreference('port');
+		$this->RemovePreference('protocol');
+		$this->RemovePreference('from');
+		$this->RemovePreference('fromuser');
+		$this->RemovePreference('sendmail');
+		$this->RemovePreference('timeout');
+		$this->RemovePreference('smtpauth',0);
+		$this->RemovePreference('username');
+		$this->RemovePreference('password');
+	}
 
 
-  /*---------------------------------------------------------
-   _SetAdminPrefs($id, $params, $return_id )
-   NOT PART OF THE MODULE API
-   ---------------------------------------------------------*/
-  function _SetAdminPrefs($id, &$params, $returnid )
-  {
-    if( !$this->CheckPermission('Modify Site Preferences') )
-      return;
+	/*---------------------------------------------------------
+	 DoAction($action, $id, $params, $return_id)
+	 ---------------------------------------------------------*/
+	function DoAction($action, $id, $params, $returnid=-1)
+	{
+		global $gCms;
+		$smarty =& $gCms->GetSmarty();
+		$smarty->assign_by_ref('mod',$this);
 
-    set_site_preference('mail_is_set',1);
+		switch ($action)
+		{
+			case 'default':
+				{
+					break;
+				}
+			case 'setadminprefs':
+				{
+					$this->_SetAdminPrefs( $id, $params, $returnid );
+					break;
+				}
+			default:
+				parent::DoAction($action,$id,$params,$returnid);
+		}
+	}
 
-    if( isset( $params['input_mailer'] ) )
-      {
-	$this->SetPreference('mailer',$params['input_mailer']);
-      }
 
-    if( isset( $params['input_host'] ) )
-      {
-	$this->SetPreference('host',$params['input_host']);
-      }
+	/*---------------------------------------------------------
+	 DisplayErrorPage($id, $params, $return_id, $message)
+	 NOT PART OF THE MODULE API
+	 ---------------------------------------------------------*/
+	function _DisplayErrorPage($id, &$params, $returnid, $message='')
+	{
+		$this->smarty->assign('title_error', $this->Lang('error'));
+		if ($message != '')
+		{
+			$this->smarty->assign('message', $message);
+		}
 
-    if( isset( $params['input_port'] ) )
-      {
-	$this->SetPreference('port',$params['input_port']);
-      }
+		// Display the populated template
+		echo $this->ProcessTemplate('error.tpl');
+	}
 
-    if( isset( $params['input_from'] ) )
-      {
-	$this->SetPreference('from',$params['input_from']);
-      }
+	//////////////////////////////////////////////////////////////////////
+	//// BEGIN API SECTION
+	//////////////////////////////////////////////////////////////////////
 
-    if( isset( $params['input_fromuser'] ) )
-      {
-	$this->SetPreference('fromuser',$params['input_fromuser']);
-      }
+
/*---------------------------------------------------------$this->GetPreference('port'),
+	 6, 8));
+	 reset()
+	 NOT PART OF THE MODULE API
+	 ---------------------------------------------------------*/
+	function reset()
+	{
+		$this->_load();
+		$this->the_mailer->Timeout = $this->GetPreference('timeout');
+		$this->the_mailer->Sendmail = $this->GetPreference('sendmail');
+		$this->the_mailer->Port   = $this->GetPreference('port');
+		$this->the_mailer->Protocol = $this->GetPreference('protocol');
+		$this->the_mailer->Mailer = $this->GetPreference('mailer');
+		$this->the_mailer->FromName = $this->GetPreference('fromuser');
+		$this->the_mailer->From = $this->GetPreference('from');
+		$this->the_mailer->Host = $this->GetPreference('host');
+		$this->the_mailer->SMTPAuth = $this->GetPreference('smtpauth');
+		$this->the_mailer->Username = $this->GetPreference('username');
+		$this->the_mailer->Password = $this->GetPreference('password');
+		$this->the_mailer->ClearAddresses();
+		$this->the_mailer->ClearAttachments();
+		$this->the_mailer->ClearCustomHeaders();
+		$this->the_mailer->ClearBCCs();
+		$this->the_mailer->ClearCCs();
+		$this->the_mailer->ClearReplyTos();
+		$charset = $this->GetPreference('charset');
+		if( !empty($charset) ) {
+			$this->SetCharSet($charset);
+		}
+	}
 
-    if( isset( $params['input_sendmail'] ) )
-      {
-	$this->SetPreference('sendmail',$params['input_sendmail']);
-      }
 
-    if( isset( $params['input_timeout'] ) )
-      {
-	$this->SetPreference('timeout',$params['input_timeout']);
-      }
+	/*---------------------------------------------------------
+	 _SetAdminPrefs($id, $params, $return_id )
+	 NOT PART OF THE MODULE API
+	 ---------------------------------------------------------*/
+	function _SetAdminPrefs($id, &$params, $returnid )
+	{
+		if( !$this->CheckPermission('Modify Site Preferences') )
+		return;
 
-    if( isset( $params['input_smtpauth'] ) )
-      {
-	$this->SetPreference('smtpauth',$params['input_smtpauth']);
-      }
-    else
-      {
-	$this->SetPreference('smtpauth',0);
-      }
+		set_site_preference('mail_is_set',1);
 
-    if( isset( $params['input_username'] ) )
-      {
-	$this->SetPreference('username',$params['input_username']);
-      }
+		if( isset( $params['input_mailer'] ) )
+		{
+			$this->SetPreference('mailer',$params['input_mailer']);
+		}
 
-    if( isset( $params['input_password'] ) )
-      {
-	$this->SetPreference('password',$params['input_password']);
-      }
+		if( isset( $params['input_host'] ) )
+		{
+			$this->SetPreference('host',$params['input_host']);
+		}
 
-    if( isset( $params['input_charset'] ) )
-      {
-	$this->SetPreference('charset',trim($params['input_charset']));
-      }
+		if( isset( $params['input_port'] ) )
+		{
+			$this->SetPreference('port',$params['input_port']);
+		}
 
-    $this->reset();
+		if( isset( $params['input_protocol'] ) )
+		{
+			$this->SetPreference('protocol',$params['input_protocol']);
+		}
 
-    if( isset( $params['sendtest'] ) )
-      {
-	// here we're gonna send a nice, hard coded test message
-	if( !isset( $params['input_testaddress'] ) ||
trim($params['input_testaddress']) == '' )
-	  {
-	    $this->_DisplayErrorPage( $id, $params, $returnid, 
-				      $this->Lang('error_notestaddress'));
-	    return;
-	  }
-	else
-	  {
-	    $this->AddAddress( $params['input_testaddress'] );
-	    $this->SetBody( $this->Lang('testbody'));
-	    $this->SetSubject( $this->Lang('testsubject'));
-	    $this->Send();
-	    $this->reset(); // yes, another reset
-	  }
-      }
+		if( isset( $params['input_from'] ) )
+		{
+			$this->SetPreference('from',$params['input_from']);
+		}
 
-    $this->Redirect( $id, 'defaultadmin', $returnid, $params );
-  }
+		if( isset( $params['input_fromuser'] ) )
+		{
+			$this->SetPreference('fromuser',$params['input_fromuser']);
+		}
 
-  ////////////////////////////////////////////////////////////
-  //                     UTILITIES                          //
-  ////////////////////////////////////////////////////////////
-  function _load()
-  {
-    if( $this->the_mailer == NULL )
-      {
-	require_once(dirname(__FILE__).'/phpmailer/class.phpmailer.php' );
-	$this->the_mailer = new PHPMailer;
-	$this->the_mailer->PluginDir=dirname(__FILE__).'/phpmailer/';
-	$this->reset();
-      }
-  }
+		if( isset( $params['input_sendmail'] ) )
+		{
+			$this->SetPreference('sendmail',$params['input_sendmail']);
+		}
 
-  ////////////////////////////////////////////////////////////
-  //                     API FUNCTIONS                      //
-  ////////////////////////////////////////////////////////////
+		if( isset( $params['input_timeout'] ) )
+		{
+			$this->SetPreference('timeout',$params['input_timeout']);
+		}
 
-  function GetAltBody()
-  {
-    $this->_load();
-    return $this->the_mailer->AltBody;
-  }
+		if( isset( $params['input_smtpauth'] ) )
+		{
+			$this->SetPreference('smtpauth',$params['input_smtpauth']);
+		}
+		else
+		{
+			$this->SetPreference('smtpauth',0);
+		}
 
-  function SetAltBody( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->AltBody = $txt;
-  }
+		if( isset( $params['input_username'] ) )
+		{
+			$this->SetPreference('username',$params['input_username']);
+		}
 
-  function GetBody()
-  {
-    $this->_load();
-    return $this->the_mailer->Body;
-  }
+		if( isset( $params['input_password'] ) )
+		{
+			$this->SetPreference('password',$params['input_password']);
+		}
 
-  function SetBody( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Body = $txt;
-  }
+		if( isset( $params['input_charset'] ) )
+		{
+			$this->SetPreference('charset',trim($params['input_charset']));
+		}
 
-  function GetCharSet()
-  {
-    $this->_load();
-    return $this->the_mailer->CharSet;
-  }
+		$this->reset();
 
-  function SetCharSet( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->CharSet = $txt;
-  }
+		if( isset( $params['sendtest'] ) )
+		{
+			// here we're gonna send a nice, hard coded test message
+			if( !isset( $params['input_testaddress'] ) ||
trim($params['input_testaddress']) == '' )
+			{
+				$this->_DisplayErrorPage( $id, $params, $returnid,
+				$this->Lang('error_notestaddress'));
+				return;
+			}
+			else
+			{
+				$this->AddAddress( $params['input_testaddress'] );
+				$this->SetBody( $this->Lang('testbody'));
+				$this->SetSubject( $this->Lang('testsubject'));
+				$this->Send();
+				$this->reset(); // yes, another reset
+			}
+		}
 
-  function GetConfirmReadingTo()
-  {
-    $this->_load();
-    return $this->the_mailer->ConfirmReadingTo;
-  }
+		$this->Redirect( $id, 'defaultadmin', $returnid, $params );
+	}
 
-  function SetConfirmReadingTo( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->ConfirmReadingTo = $txt;
-  }
+	////////////////////////////////////////////////////////////
+	//                     UTILITIES                          //
+	////////////////////////////////////////////////////////////
+	function _load()
+	{
+		if( $this->the_mailer == NULL )
+		{
+			require_once(dirname(__FILE__).'/phpmailer/class.phpmailer.php' );
+			$this->the_mailer = new PHPMailer;
+			$this->the_mailer->PluginDir=dirname(__FILE__).'/phpmailer/';
+			$this->reset();
+		}
+	}
 
-  function GetContentType()
-  {
-    $this->_load();
-    return $this->the_mailer->ContentType;
-  }
+	////////////////////////////////////////////////////////////
+	//                     API FUNCTIONS                      //
+	////////////////////////////////////////////////////////////
 
-  function SetContentType( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->ContentType = $txt;
-  }
+	function GetAltBody()
+	{
+		$this->_load();
+		return $this->the_mailer->AltBody;
+	}
 
-  function GetEncoding()
-  {
-    $this->_load();
-    return $this->the_mailer->Encoding;
-  }
+	function SetAltBody( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->AltBody = $txt;
+	}
 
-  function SetEncoding( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Encoding = $txt;
-  }
+	function GetBody()
+	{
+		$this->_load();
+		return $this->the_mailer->Body;
+	}
 
-  function GetErrorInfo()
-  {
-    $this->_load();
-    return $this->the_mailer->ErrorInfo;
-  }
+	function SetBody( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Body = $txt;
+	}
 
-  function GetFrom()
-  {
-    $this->_load();
-    return $this->the_mailer->From;
-  }
+	function GetCharSet()
+	{
+		$this->_load();
+		return $this->the_mailer->CharSet;
+	}
+
+	function SetCharSet( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->CharSet = $txt;
+	}
+
+	function GetConfirmReadingTo()
+	{
+		$this->_load();
+		return $this->the_mailer->ConfirmReadingTo;
+	}
+
+	function SetConfirmReadingTo( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->ConfirmReadingTo = $txt;
+	}
+
+	function GetContentType()
+	{
+		$this->_load();
+		return $this->the_mailer->ContentType;
+	}
 
-  function SetFrom( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->From = $txt;
-  }
+	function SetContentType( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->ContentType = $txt;
+	}
 
-  function GetFromName()
-  {
-    $this->_load();
-    return $this->the_mailer->FromName;
-  }
+	function GetEncoding()
+	{
+		$this->_load();
+		return $this->the_mailer->Encoding;
+	}
 
-  function SetFromName( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->FromName = $txt;
-  }
+	function SetEncoding( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Encoding = $txt;
+	}
 
-  function GetHelo()
-  {
-    $this->_load();
-    return $this->the_mailer->Helo;
-  }
+	function GetErrorInfo()
+	{
+		$this->_load();
+		return $this->the_mailer->ErrorInfo;
+	}
 
-  function SetHelo( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Helo = $txt;
-  }
+	function GetFrom()
+	{
+		$this->_load();
+		return $this->the_mailer->From;
+	}
 
-  function GetHost()
-  {
-    $this->_load();
-    return $this->the_mailer->Host;
-  }
+	function SetFrom( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->From = $txt;
+	}
 
-  function SetHost( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Host = $txt;
-  }
+	function GetFromName()
+	{
+		$this->_load();
+		return $this->the_mailer->FromName;
+	}
+
+	function SetFromName( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->FromName = $txt;
+	}
+
+	function GetHelo()
+	{
+		$this->_load();
+		return $this->the_mailer->Helo;
+	}
+
+	function SetHelo( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Helo = $txt;
+	}
+
+	function GetHost()
+	{
+		$this->_load();
+		return $this->the_mailer->Host;
+	}
+
+	function SetHost( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Host = $txt;
+	}
+
+	function GetHostname()
+	{
+		$this->_load();
+		return $this->the_mailer->Hostname;
+	}
+
+	function SetHostname( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Hostname = $txt;
+	}
+
+	function GetMailer()
+	{
+		$this->_load();
+		return $this->the_mailer->Mailer;
+	}
 
-  function GetHostname()
-  {
-    $this->_load();
-    return $this->the_mailer->Hostname;
-  }
+	function SetMailer( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Mailer = $txt;
+	}
 
-  function SetHostname( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Hostname = $txt;
-  }
+	function GetPassword()
+	{
+		$this->_load();
+		return $this->the_mailer->Password;
+	}
 
-  function GetMailer()
-  {
-    $this->_load();
-    return $this->the_mailer->Mailer;
-  }
+	function SetPassword( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Password = $txt;
+	}
 
-  function SetMailer( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Mailer = $txt;
-  }
+	function GetPort()
+	{
+		$this->_load();
+		return $this->the_mailer->Port;
+	}
 
-  function GetPassword()
-  {
-    $this->_load();
-    return $this->the_mailer->Password;
-  }
+	function SetPort( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Port = $txt;
+	}
 
-  function SetPassword( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Password = $txt;
-  }
+	function GetProtocol()
+	{
+		$this->_load();
+		return $this->the_mailer->Protocol;
+	}
 
-  function GetPort()
-  {
-    $this->_load();
-    return $this->the_mailer->Port;
-  }
+	function SetProtocol( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Protocol = $txt;
+	}
 
-  function SetPort( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Port = $txt;
-  }
+	function GetPriority()
+	{
+		$this->_load();
+		return $this->the_mailer->Priority;
+	}
 
-  function GetPriority()
-  {
-    $this->_load();
-    return $this->the_mailer->Priority;
-  }
+	function SetPriority( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Priority = $txt;
+	}
 
-  function SetPriority( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Priority = $txt;
-  }
+	function GetSender()
+	{
+		$this->_load();
+		return $this->the_mailer->Sender;
+	}
 
-  function GetSender()
-  {
-    $this->_load();
-    return $this->the_mailer->Sender;
-  }
+	function SetSender( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Sender = $txt;
+	}
 
-  function SetSender( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Sender = $txt;
-  }
+	function GetSendmail()
+	{
+		$this->_load();
+		return $this->the_mailer->Sendmail;
+	}
 
-  function GetSendmail()
-  {
-    $this->_load();
-    return $this->the_mailer->Sendmail;
-  }
+	function SetSendmail( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Sendmail = $txt;
+	}
 
-  function SetSendmail( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Sendmail = $txt;
-  }
+	function GetSMTPAuth()
+	{
+		$this->_load();
+		return $this->the_mailer->SMTPAuth;
+	}
 
-  function GetSMTPAuth()
-  {
-    $this->_load();
-    return $this->the_mailer->SMTPAuth;
-  }
+	function SetSMTPAuth( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->SMTPAuth = $txt;
+	}
 
-  function SetSMTPAuth( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->SMTPAuth = $txt;
-  }
+	function GetSMTPDebug()
+	{
+		$this->_load();
+		return $this->the_mailer->SMTPDebug;
+	}
 
-  function GetSMTPDebug()
-  {
-    $this->_load();
-    return $this->the_mailer->SMTPDebug;
-  }
+	function SetSMTPDebug( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->SMTPDebug = $txt;
+	}
 
-  function SetSMTPDebug( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->SMTPDebug = $txt;
-  }
+	function GetSMTPKeepAlive()
+	{
+		$this->_load();
+		return $this->the_mailer->SMTPKeepAlive;
+	}
 
-  function GetSMTPKeepAlive()
-  {
-    $this->_load();
-    return $this->the_mailer->SMTPKeepAlive;
-  }
+	function SetSMTPKeepAlive( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->SMTPKeepAlive = $txt;
+	}
 
-  function SetSMTPKeepAlive( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->SMTPKeepAlive = $txt;
-  }
+	function GetSubject()
+	{
+		$this->_load();
+		return $this->the_mailer->Subject;
+	}
 
-  function GetSubject()
-  {
-    $this->_load();
-    return $this->the_mailer->Subject;
-  }
+	function SetSubject( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Subject = $txt;
+	}
 
-  function SetSubject( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Subject = $txt;
-  }
+	function GetTimeout()
+	{
+		$this->_load();
+		return $this->the_mailer->Timeout;
+	}
 
-  function GetTimeout()
-  {
-    $this->_load();
-    return $this->the_mailer->Timeout;
-  }
+	function SetTimeout( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Timeout = $txt;
+	}
 
-  function SetTimeout( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Timeout = $txt;
-  }
+	function GetUsername()
+	{
+		$this->_load();
+		return $this->the_mailer->Username;
+	}
 
-  function GetUsername()
-  {
-    $this->_load();
-    return $this->the_mailer->Username;
-  }
+	function SetUsername( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->Username = $txt;
+	}
 
-  function SetUsername( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->Username = $txt;
-  }
+	function GetWordWrap()
+	{
+		$this->_load();
+		return $this->the_mailer->WordWrap;
+	}
 
-  function GetWordWrap()
-  {
-    $this->_load();
-    return $this->the_mailer->WordWrap;
-  }
+	function SetWordWrap( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->WordWrap = $txt;
+	}
 
-  function SetWordWrap( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->WordWrap = $txt;
-  }
+	function AddAddress( $address, $name = '' )
+	{
+		$this->_load();
+		return $this->the_mailer->AddAddress( $address, $name );
+	}
 
-  function AddAddress( $address, $name = '' )
-  {
-    $this->_load();
-    return $this->the_mailer->AddAddress( $address, $name );
-  }
+	function AddAttachment( $path, $name = '', $encoding = 'base64',
+	$type = 'application/octet-stream' )
+	{
+		$this->_load();
+		return $this->the_mailer->AddAttachment( $path, $name, $encoding, $type );
+	}
 
-  function AddAttachment( $path, $name = '', $encoding = 'base64',
-			  $type = 'application/octet-stream' )
-  {
-    $this->_load();
-    return $this->the_mailer->AddAttachment( $path, $name, $encoding, $type );
-  }
+	function AddBCC( $addr, $name = '' )
+	{
+		$this->_load();
+		$this->the_mailer->AddBCC( $addr, $name );
+	}
 
-  function AddBCC( $addr, $name = '' )
-  {
-    $this->_load();
-    $this->the_mailer->AddBCC( $addr, $name );
-  }
+	function AddCC( $addr, $name = '' )
+	{
+		$this->_load();
+		$this->the_mailer->AddCC( $addr, $name );
+	}
 
-  function AddCC( $addr, $name = '' )
-  {
-    $this->_load();
-    $this->the_mailer->AddCC( $addr, $name );
-  }
+	function AddCustomHeader( $txt )
+	{
+		$this->_load();
+		$this->the_mailer->AddCustomHeader( $txt );
+	}
 
-  function AddCustomHeader( $txt )
-  {
-    $this->_load();
-    $this->the_mailer->AddCustomHeader( $txt );
-  }
+	function AddEmbeddedImage( $path, $cid, $name = '', $encoding = 'base64',
+	$type = 'application/octet-stream' )
+	{
+		$this->_load();
+		return $this->the_mailer->AddEmbeddedImage( $path, $cid,
+		$name, $encoding, $type );
+	}
 
-  function AddEmbeddedImage( $path, $cid, $name = '', $encoding = 'base64',
-			     $type = 'application/octet-stream' )
-  {
-    $this->_load();
-    return $this->the_mailer->AddEmbeddedImage( $path, $cid, 
-						$name, $encoding, $type );
-  }
+	function AddReplyTo( $addr, $name = '' )
+	{
+		$this->_load();
+		$this->the_mailer->AddReplyTo( $addr, $name );
+	}
 
-  function AddReplyTo( $addr, $name = '' )
-  {
-    $this->_load();
-    $this->the_mailer->AddReplyTo( $addr, $name );
-  }
 
+	function AddStringAttachment( $string, $filename, $encoding = 'base64',
+	$type = 'application/octet-stream' )
+	{
+		$this->_load();
+		$this->the_mailer->AddStringAttachment( $string, $filename, $encoding, $type
);
+	}
 
-  function AddStringAttachment( $string, $filename, $encoding = 'base64',
-				$type = 'application/octet-stream' )
-  {
-    $this->_load();
-    $this->the_mailer->AddStringAttachment( $string, $filename, $encoding,
$type );
-  }
+	function ClearAddresses()
+	{
+		$this->_load();
+		$this->the_mailer->ClearAddresses();
+	}
 
-  function ClearAddresses()
-  {
-    $this->_load();
-    $this->the_mailer->ClearAddresses();
-  }
+	function ClearAllRecipients()
+	{
+		$this->_load();
+		$this->the_mailer->ClearAllRecipients();
+	}
 
-  function ClearAllRecipients()
-  {
-    $this->_load();
-    $this->the_mailer->ClearAllRecipients();
-  }
+	function ClearAttachments()
+	{
+		$this->_load();
+		$this->the_mailer->ClearAttachments();
+	}
 
-  function ClearAttachments()
-  {
-    $this->_load();
-    $this->the_mailer->ClearAttachments();
-  }
+	function ClearBCCs()
+	{
+		$this->_load();
+		$this->the_mailer->ClearBCCs();
+	}
 
-  function ClearBCCs()
-  {
-    $this->_load();
-    $this->the_mailer->ClearBCCs();
-  }
+	function ClearCCs()
+	{
+		$this->_load();
+		$this->the_mailer->ClearCCs();
+	}
 
-  function ClearCCs()
-  {
-    $this->_load();
-    $this->the_mailer->ClearCCs();
-  }
+	function ClearCustomHeaders()
+	{
+		$this->_load();
+		$this->the_mailer->ClearCustomHeaders();
+	}
 
-  function ClearCustomHeaders()
-  {
-    $this->_load();
-    $this->the_mailer->ClearCustomHeaders();
-  }
+	function ClearReplyTos()
+	{
+		$this->_load();
+		$this->the_mailer->ClearReplyTos();
+	}
 
-  function ClearReplyTos()
-  {
-    $this->_load();
-    $this->the_mailer->ClearReplyTos();
-  }
-  
-  function IsError()
-  {
-    $this->_load();
-    return $this->the_mailer->IsError();
-  }
+	function IsError()
+	{
+		$this->_load();
+		return $this->the_mailer->IsError();
+	}
 
-  function IsHTML($var = true)
-  {
-    $this->_load();
-    return $this->the_mailer->IsHTML($var);
-  }
+	function IsHTML($var = true)
+	{
+		$this->_load();
+		return $this->the_mailer->IsHTML($var);
+	}
 
-  function IsMail()
-  {
-    $this->_load();
-    return $this->the_mailer->IsMail();
-  }
+	function IsMail()
+	{
+		$this->_load();
+		return $this->the_mailer->IsMail();
+	}
 
-  function IsQmail()
-  {
-    $this->_load();
-    return $this->the_mailer->IsQmail();
-  }
+	function IsQmail()
+	{
+		$this->_load();
+		return $this->the_mailer->IsQmail();
+	}
 
-  function IsSendmail()
-  {
-    $this->_load();
-    return $this->the_mailer->IsSendmail();
-  }
+	function IsSendmail()
+	{
+		$this->_load();
+		return $this->the_mailer->IsSendmail();
+	}
 
-  function IsSMTP()
-  {
-    $this->_load();
-    return $this->the_mailer->IsSMTP();
-  }
+	function IsSMTP()
+	{
+		$this->_load();
+		return $this->the_mailer->IsSMTP();
+	}
 
-  function Send()
-  {
-    $this->_load();
-    return $this->the_mailer->Send();
-  }
+	function Send()
+	{
+		$this->_load();
+		return $this->the_mailer->Send();
+	}
 
-  function SetLanguage( $lang_type, $lang_path = '' )
-  {
-    $this->_load();
-    return $this->the_mailer->SetLanguage( $lang_type, $lang_path );
-  }
+	function SetLanguage( $lang_type, $lang_path = '' )
+	{
+		$this->_load();
+		return $this->the_mailer->SetLanguage( $lang_type, $lang_path );
+	}
 
-  function SmtpClose()
-  {
-    $this->_load();
-    return $this->the_mailer->SmtpClose();
-  }
+	function SmtpClose()
+	{
+		$this->_load();
+		return $this->the_mailer->SmtpClose();
+	}
 
 } // class CMSMailer
 
Index: CMSMailer/action.defaultadmin.php
===================================================================
--- CMSMailer/action.defaultadmin.php	(revision 41)
+++ CMSMailer/action.defaultadmin.php	(working copy)
@@ -25,110 +25,115 @@
 #
 #-------------------------------------------------------------------------
 
-    if( !$this->CheckPermission('Modify Site Preferences') )
-      return;
+if( !$this->CheckPermission('Modify Site Preferences') )
+return;
 
-    $this->smarty->assign('endform',
-			  $this->CreateFormEnd());
-    $this->smarty->assign('startform',
-			  $this->CreateFormStart( $id, 'setadminprefs', $returnid ));
+$this->smarty->assign('endform',
+$this->CreateFormEnd());
+$this->smarty->assign('startform',
+$this->CreateFormStart( $id, 'setadminprefs', $returnid ));
 
-    $maileritems = array();
-    $maileritems['mail'] = 'mail';
-    $maileritems['sendmail'] = 'sendmail';
-    $maileritems['smtp'] = 'smtp';
-    $this->smarty->assign('prompt_mailer', $this->Lang('mailer'));
-    $this->smarty->assign('info_mailer', $this->Lang('info_mailer'));
-    $this->smarty->assign('input_mailer',
-			  $this->CreateInputDropdown( $id, 'input_mailer',
-						      $maileritems, -1,
-						      $this->GetPreference('mailer',-1)));
+$maileritems = array();
+$maileritems['mail'] = 'mail';
+$maileritems['sendmail'] = 'sendmail';
+$maileritems['smtp'] = 'smtp';
+$this->smarty->assign('prompt_mailer', $this->Lang('mailer'));
+$this->smarty->assign('info_mailer', $this->Lang('info_mailer'));
+$this->smarty->assign('input_mailer',
+$this->CreateInputDropdown( $id, 'input_mailer',
+$maileritems, -1,
+$this->GetPreference('mailer',-1)));
 
-    $this->smarty->assign('prompt_host', $this->Lang('host'));
-    $this->smarty->assign('info_host', $this->Lang('info_host'));
-    $this->smarty->assign('input_host',
-			  $this->CreateInputText( $id, 'input_host',
-						  $this->GetPreference('host'),
-						  50, 80 ));
+$this->smarty->assign('prompt_host', $this->Lang('host'));
+$this->smarty->assign('info_host', $this->Lang('info_host'));
+$this->smarty->assign('input_host',
+$this->CreateInputText( $id, 'input_host',
+$this->GetPreference('host'),
+50, 80 ));
 
-    $this->smarty->assign('prompt_port', $this->Lang('port'));
-    $this->smarty->assign('info_port', $this->Lang('info_port'));
-    $this->smarty->assign('input_port',
-			  $this->CreateInputText( $id, 'input_port',
-						  $this->GetPreference('port'),
-						  6, 8));
+$this->smarty->assign('prompt_port', $this->Lang('port'));
+$this->smarty->assign('info_port', $this->Lang('info_port'));
+$this->smarty->assign('input_port',
+$this->CreateInputText( $id, 'input_port',
+$this->GetPreference('port'),
+6, 8));
 
-    $this->smarty->assign('prompt_from', $this->Lang('from'));
-    $this->smarty->assign('info_from', $this->Lang('info_from'));
-    $this->smarty->assign('input_from',
-			  $this->CreateInputText( $id, 'input_from',
-						  $this->GetPreference('from'),
-						  80, 80));
+$this->smarty->assign('prompt_protocol', $this->Lang('protocol'));
+$this->smarty->assign('info_protocol', $this->Lang('info_protocol'));
+$this->smarty->assign('input_protocol',
+$this->CreateInputRadioGroup( $id, 'input_protocol',Array(
$this->Lang('protocol_none') => '',$this->Lang('protocol_ssl') =>
'ssl',$this->Lang('protocol_tls') => 'tls' ),$this->GetPreference('protocol')
));
 
-    $this->smarty->assign('prompt_fromuser',$this->Lang('fromuser'));
-    $this->smarty->assign('info_fromuser', $this->Lang('info_fromuser'));
-    $this->smarty->assign('input_fromuser',
-			  $this->CreateInputText( $id, 'input_fromuser',
-						  $this->GetPreference('fromuser'),
-						  50, 80));
-			  
-    $this->smarty->assign('prompt_sendmail',$this->Lang('sendmail'));
-    $this->smarty->assign('info_sendmail', $this->Lang('info_sendmail'));
-    $this->smarty->assign('input_sendmail',
-			  $this->CreateInputText( $id, 'input_sendmail',
-						  $this->GetPreference('sendmail'),
-						  50, 255));
+$this->smarty->assign('prompt_from', $this->Lang('from'));
+$this->smarty->assign('info_from', $this->Lang('info_from'));
+$this->smarty->assign('input_from',
+$this->CreateInputText( $id, 'input_from',
+$this->GetPreference('from'),
+80, 80));
 
-    $this->smarty->assign('prompt_timeout', $this->Lang('timeout'));
-    $this->smarty->assign('info_timeout', $this->Lang('info_timeout'));
-    $this->smarty->assign('input_timeout',
-			  $this->CreateInputText( $id, 'input_timeout',
-						  $this->GetPreference('timeout'),
-						  5, 5));
+$this->smarty->assign('prompt_fromuser',$this->Lang('fromuser'));
+$this->smarty->assign('info_fromuser', $this->Lang('info_fromuser'));
+$this->smarty->assign('input_fromuser',
+$this->CreateInputText( $id, 'input_fromuser',
+$this->GetPreference('fromuser'),
+50, 80));
+	
+$this->smarty->assign('prompt_sendmail',$this->Lang('sendmail'));
+$this->smarty->assign('info_sendmail', $this->Lang('info_sendmail'));
+$this->smarty->assign('input_sendmail',
+$this->CreateInputText( $id, 'input_sendmail',
+$this->GetPreference('sendmail'),
+50, 255));
 
-    $this->smarty->assign('prompt_smtpauth', $this->Lang('smtpauth'));
-    $this->smarty->assign('info_smtpauth', $this->Lang('info_smtpauth'));
-    $this->smarty->assign('input_smtpauth',
-			  $this->CreateInputCheckbox($id, 'input_smtpauth',1,
-						     $this->GetPreference('smtpauth')));
+$this->smarty->assign('prompt_timeout', $this->Lang('timeout'));
+$this->smarty->assign('info_timeout', $this->Lang('info_timeout'));
+$this->smarty->assign('input_timeout',
+$this->CreateInputText( $id, 'input_timeout',
+$this->GetPreference('timeout'),
+5, 5));
 
-    $this->smarty->assign('prompt_username', $this->Lang('username'));
-    $this->smarty->assign('info_username', $this->Lang('info_username'));
-    $this->smarty->assign('input_username',
-			  $this->CreateInputText( $id, 'input_username',
-						  $this->GetPreference('username'),
-						  30, 255));
+$this->smarty->assign('prompt_smtpauth', $this->Lang('smtpauth'));
+$this->smarty->assign('info_smtpauth', $this->Lang('info_smtpauth'));
+$this->smarty->assign('input_smtpauth',
+$this->CreateInputCheckbox($id, 'input_smtpauth',1,
+$this->GetPreference('smtpauth')));
 
-    $this->smarty->assign('prompt_password', $this->Lang('password'));
-    $this->smarty->assign('info_password', $this->Lang('info_password'));
-    $this->smarty->assign('input_password',
-			  $this->CreateInputPassword( $id, 'input_password',
-						      $this->GetPreference('password'), 30, 30));
+$this->smarty->assign('prompt_username', $this->Lang('username'));
+$this->smarty->assign('info_username', $this->Lang('info_username'));
+$this->smarty->assign('input_username',
+$this->CreateInputText( $id, 'input_username',
+$this->GetPreference('username'),
+30, 255));
 
-    $this->smarty->assign('prompt_testaddress', 
-			  $this->Lang('prompt_testaddress'));
-    $this->smarty->assign('input_testaddress',
-			  $this->CreateInputText( $id, 'input_testaddress',
+$this->smarty->assign('prompt_password', $this->Lang('password'));
+$this->smarty->assign('info_password', $this->Lang('info_password'));
+$this->smarty->assign('input_password',
+$this->CreateInputPassword( $id, 'input_password',
+$this->GetPreference('password'), 30, 30));
+
+$this->smarty->assign('prompt_testaddress',
+$this->Lang('prompt_testaddress'));
+$this->smarty->assign('input_testaddress',
+$this->CreateInputText( $id, 'input_testaddress',
 						  '',
-						  40, 60));
-    $this->smarty->assign('sendtest',
-			  $this->CreateInputSubmit( $id, 'sendtest',
-						    $this->Lang('sendtest'), '', '',
$this->Lang('sendtestmailconfirm')));
+40, 60));
+$this->smarty->assign('sendtest',
+$this->CreateInputSubmit( $id, 'sendtest',
+$this->Lang('sendtest'), '', '', $this->Lang('sendtestmailconfirm')));
 
-    $this->smarty->assign('prompt_charset',
-		    $this->Lang('charset'));
-    $this->smarty->assign('input_charset',
-		    $this->CreateInputText($id,'input_charset',
-					   $this->GetPreference('charset'),
-					   40,40));
+$this->smarty->assign('prompt_charset',
+$this->Lang('charset'));
+$this->smarty->assign('input_charset',
+$this->CreateInputText($id,'input_charset',
+$this->GetPreference('charset'),
+40,40));
 
-    $this->smarty->assign('submit',
-			  $this->CreateInputSubmit( $id, 'submit', 
-						    $this->Lang('submit'), '', '',
-						    $this->Lang('settingsconfirm')));
-    $this->smarty->assign('cancel',
-			  $this->CreateInputSubmit( $id, 'cancel', 
-						    $this->Lang('cancel')));
+$this->smarty->assign('submit',
+$this->CreateInputSubmit( $id, 'submit',
+$this->Lang('submit'), '', '',
+$this->Lang('settingsconfirm')));
+$this->smarty->assign('cancel',
+$this->CreateInputSubmit( $id, 'cancel',
+$this->Lang('cancel')));
 
-    echo $this->ProcessTemplate('prefs.tpl');
+echo $this->ProcessTemplate('prefs.tpl');
 ?>
\ No newline at end of file
Index: CMSMailer/lang/en_US.php
===================================================================
--- CMSMailer/lang/en_US.php	(revision 41)
+++ CMSMailer/lang/en_US.php	(working copy)
@@ -15,6 +15,7 @@
 $lang['mailer']   = 'Mailer method';
 $lang['host']     = 'SMTP host name<br/><i>(or IP address)</i>';
 $lang['port']     = 'Port of SMTP server';
+$lang['protocol'] = 'Use encryption protocol';
 $lang['from']     = 'From address';
 $lang['fromuser'] = 'From Username';
 $lang['sendmail'] = 'Sendmail location';
@@ -24,6 +25,7 @@
$lang['info_mailer'] = 'Mail method to use (sendmail, smtp, mail).  Usually
smtp is the most reliable.';
 $lang['info_host'] = 'SMTP hostname (only valid for the smtp mailer method)';
$lang['info_port'] = 'SMTP port number (usually 25) (only valid for the smtp
mailer method)';
+$lang['info_protocol'] = 'Encryption method to use (none, ssl, tls). SSL and
TLS usually require setting the port to 465.';
$lang['info_from'] = 'Address used as the sender in all emails.
<br/><strong>Note</strong>, this email address must be set correctly for your
host or you will have difficulty sending emails.<br/>If you do not know the
proper value for this setting, you may need to contact your host.';
 $lang['info_fromuser'] = 'Friendly name used for sending all emails';
$lang['info_sendmail'] = 'The complete path to your sendmail executable (only
valid for the sendmail mailer method)';
@@ -317,4 +319,8 @@
<p>Copyright &copy; 2005, Robert Campbell <a
href=\'mailto:calguy1000@hotmail.com\'>&lt;calguy1000@hotmail.com&gt;</a>. All
Rights Are Reserved.</p>
<p>This module has been released under the <a
href=\'http://www.gnu.org/licenses/licenses.html#GPL\'>GNU Public License</a>.
You must agree to this license before using the module.</p>
 ';
+
+$lang['protocol_none'] = 'None';
+$lang['protocol_ssl']  = 'SSL';
+$lang['protocol_tls']  = 'TLS';
 ?>
Index: CMSMailer/phpmailer/class.phpmailer.php
===================================================================
--- CMSMailer/phpmailer/class.phpmailer.php	(revision 41)
+++ CMSMailer/phpmailer/class.phpmailer.php	(working copy)
@@ -19,1483 +19,1490 @@
  */

 class PHPMailer

 {

-    /////////////////////////////////////////////////

-    // PUBLIC VARIABLES

-    /////////////////////////////////////////////////

+	/////////////////////////////////////////////////

+	// PUBLIC VARIABLES

+	/////////////////////////////////////////////////

+

+	/**

+	 * Email priority (1 = High, 3 = Normal, 5 = low).

+	 * @var int

+	 */

+	var $Priority          = 3;

+

+	/**

+	 * Sets the CharSet of the message.

+	 * @var string

+	 */

+	var $CharSet           = "iso-8859-1";

+

+	/**

+	 * Sets the Content-type of the message.

+	 * @var string

+	 */

+	var $ContentType        = "text/plain";

+

+	/**

+	 * Sets the Encoding of the message. Options for this are "8bit",

+	 * "7bit", "binary", "base64", and "quoted-printable".

+	 * @var string

+	 */

+	var $Encoding          = "8bit";

+

+	/**

+	 * Holds the most recent mailer error message.

+	 * @var string

+	 */

+	var $ErrorInfo         = "";

+

+	/**

+	 * Sets the From email address for the message.

+	 * @var string

+	 */

+	var $From               = "root@localhost";

 

-    /**

-     * Email priority (1 = High, 3 = Normal, 5 = low).

-     * @var int

-     */

-    var $Priority          = 3;

+	/**

+	 * Sets the From name of the message.

+	 * @var string

+	 */

+	var $FromName           = "Root User";

 

-    /**

-     * Sets the CharSet of the message.

-     * @var string

-     */

-    var $CharSet           = "iso-8859-1";

+	/**

+	 * Sets the Sender email (Return-Path) of the message.  If not empty,

+	 * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.

+	 * @var string

+	 */

+	var $Sender            = "";

 

-    /**

-     * Sets the Content-type of the message.

-     * @var string

-     */

-    var $ContentType        = "text/plain";

+	/**

+	 * Sets the Subject of the message.

+	 * @var string

+	 */

+	var $Subject           = "";

 

-    /**

-     * Sets the Encoding of the message. Options for this are "8bit",

-     * "7bit", "binary", "base64", and "quoted-printable".

-     * @var string

-     */

-    var $Encoding          = "8bit";

+	/**

+	 * Sets the Body of the message.  This can be either an HTML or text body.

+	 * If HTML then run IsHTML(true).

+	 * @var string

+	 */

+	var $Body               = "";

 

-    /**

-     * Holds the most recent mailer error message.

-     * @var string

-     */

-    var $ErrorInfo         = "";

+	/**

+	 * Sets the text-only body of the message.  This automatically sets the

+	 * email to multipart/alternative.  This body can be read by mail

+	 * clients that do not have HTML email capability such as mutt. Clients

+	 * that can read HTML will view the normal Body.

+	 * @var string

+	 */

+	var $AltBody           = "";

 

-    /**

-     * Sets the From email address for the message.

-     * @var string

-     */

-    var $From               = "root@localhost";

+	/**

+	 * Sets word wrapping on the body of the message to a given number of

+	 * characters.

+	 * @var int

+	 */

+	var $WordWrap          = 0;

 

-    /**

-     * Sets the From name of the message.

-     * @var string

-     */

-    var $FromName           = "Root User";

+	/**

+	 * Method to send mail: ("mail", "sendmail", or "smtp").

+	 * @var string

+	 */

+	var $Mailer            = "mail";

 

-    /**

-     * Sets the Sender email (Return-Path) of the message.  If not empty,

-     * will be sent via -f to sendmail or as 'MAIL FROM' in smtp mode.

-     * @var string

-     */

-    var $Sender            = "";

+	/**

+	 * Sets the path of the sendmail program.

+	 * @var string

+	 */

+	var $Sendmail          = "/usr/sbin/sendmail";

 

-    /**

-     * Sets the Subject of the message.

-     * @var string

-     */

-    var $Subject           = "";

+	/**

+	 * Path to PHPMailer plugins.  This is now only useful if the SMTP class

+	 * is in a different directory than the PHP include path.

+	 * @var string

+	 */

+	var $PluginDir         = "";

 

-    /**

-     * Sets the Body of the message.  This can be either an HTML or text body.

-     * If HTML then run IsHTML(true).

-     * @var string

-     */

-    var $Body               = "";

+	/**

+	 *  Holds PHPMailer version.

+	 *  @var string

+	 */

+	var $Version           = "1.73";

 

-    /**

-     * Sets the text-only body of the message.  This automatically sets the

-     * email to multipart/alternative.  This body can be read by mail

-     * clients that do not have HTML email capability such as mutt. Clients

-     * that can read HTML will view the normal Body.

-     * @var string

-     */

-    var $AltBody           = "";

+	/**

+	 * Sets the email address that a reading confirmation will be sent.

+	 * @var string

+	 */

+	var $ConfirmReadingTo  = "";

 

-    /**

-     * Sets word wrapping on the body of the message to a given number of 

-     * characters.

-     * @var int

-     */

-    var $WordWrap          = 0;

+	/**

+	 *  Sets the hostname to use in Message-Id and Received headers

+	 *  and as default HELO string. If empty, the value returned

+	 *  by SERVER_NAME is used or 'localhost.localdomain'.

+	 *  @var string

+	 */

+	var $Hostname          = "";

 

-    /**

-     * Method to send mail: ("mail", "sendmail", or "smtp").

-     * @var string

-     */

-    var $Mailer            = "mail";

+	/////////////////////////////////////////////////

+	// SMTP VARIABLES

+	/////////////////////////////////////////////////

 

-    /**

-     * Sets the path of the sendmail program.

-     * @var string

-     */

-    var $Sendmail          = "/usr/sbin/sendmail";

-    

-    /**

-     * Path to PHPMailer plugins.  This is now only useful if the SMTP class 

-     * is in a different directory than the PHP include path.  

-     * @var string

-     */

-    var $PluginDir         = "";

+	/**

+	 *  Sets the SMTP hosts.  All hosts must be separated by a

+	 *  semicolon.  You can also specify a different port

+	 *  for each host by using this format: [hostname:port]

+	 *  (e.g. "smtp1.example.com:25;smtp2.example.com").

+	 *  Hosts will be tried in order.

+	 *  @var string

+	 */

+	var $Host        = "localhost";

 

-    /**

-     *  Holds PHPMailer version.

-     *  @var string

-     */

-    var $Version           = "1.73";

+	/**

+	 *  Sets the default SMTP server port.

+	 *  @var int

+	 */

+	var $Port        = 25;

 

-    /**

-     * Sets the email address that a reading confirmation will be sent.

-     * @var string

-     */

-    var $ConfirmReadingTo  = "";

 

-    /**

-     *  Sets the hostname to use in Message-Id and Received headers

-     *  and as default HELO string. If empty, the value returned

-     *  by SERVER_NAME is used or 'localhost.localdomain'.

-     *  @var string

-     */

-    var $Hostname          = "";

+	/**
+	 *  Sets the encryption protocol to use.
+	 *  @var string
+	 */
+	var $Protocol     = "";
 

-    /////////////////////////////////////////////////

-    // SMTP VARIABLES

-    /////////////////////////////////////////////////

+	/**

+	 *  Sets the SMTP HELO of the message (Default is $Hostname).

+	 *  @var string

+	 */

+	var $Helo        = "";

 

-    /**

-     *  Sets the SMTP hosts.  All hosts must be separated by a

-     *  semicolon.  You can also specify a different port

-     *  for each host by using this format: [hostname:port]

-     *  (e.g. "smtp1.example.com:25;smtp2.example.com").

-     *  Hosts will be tried in order.

-     *  @var string

-     */

-    var $Host        = "localhost";

+	/**

+	 *  Sets SMTP authentication. Utilizes the Username and Password variables.

+	 *  @var bool

+	 */

+	var $SMTPAuth     = false;

 

-    /**

-     *  Sets the default SMTP server port.

-     *  @var int

-     */

-    var $Port        = 25;

+	/**

+	 *  Sets SMTP username.

+	 *  @var string

+	 */

+	var $Username     = "";

 

-    /**

-     *  Sets the SMTP HELO of the message (Default is $Hostname).

-     *  @var string

-     */

-    var $Helo        = "";

+	/**

+	 *  Sets SMTP password.

+	 *  @var string

+	 */

+	var $Password     = "";

 

-    /**

-     *  Sets SMTP authentication. Utilizes the Username and Password variables.

-     *  @var bool

-     */

-    var $SMTPAuth     = false;

+	/**

+	 *  Sets the SMTP server timeout in seconds. This function will not

+	 *  work with the win32 version.

+	 *  @var int

+	 */

+	var $Timeout      = 10;

 

-    /**

-     *  Sets SMTP username.

-     *  @var string

-     */

-    var $Username     = "";

+	/**

+	 *  Sets SMTP class debugging on or off.

+	 *  @var bool

+	 */

+	var $SMTPDebug    = false;

 

-    /**

-     *  Sets SMTP password.

-     *  @var string

-     */

-    var $Password     = "";

+	/**

+	 * Prevents the SMTP connection from being closed after each mail

+	 * sending.  If this is set to true then to close the connection

+	 * requires an explicit call to SmtpClose().

+	 * @var bool

+	 */

+	var $SMTPKeepAlive = false;

 

-    /**

-     *  Sets the SMTP server timeout in seconds. This function will not 

-     *  work with the win32 version.

-     *  @var int

-     */

-    var $Timeout      = 10;

+	/**#@+

+	 * @access private

+	 */

+	var $smtp            = NULL;

+	var $to              = array();

+	var $cc              = array();

+	var $bcc             = array();

+	var $ReplyTo         = array();

+	var $attachment      = array();

+	var $CustomHeader    = array();

+	var $message_type    = "";

+	var $boundary        = array();

+	var $language        = array();

+	var $error_count     = 0;

+	var $LE              = "\n";

+	/**#@-*/

 

-    /**

-     *  Sets SMTP class debugging on or off.

-     *  @var bool

-     */

-    var $SMTPDebug    = false;

+	/////////////////////////////////////////////////

+	// VARIABLE METHODS

+	/////////////////////////////////////////////////

 

-    /**

-     * Prevents the SMTP connection from being closed after each mail 

-     * sending.  If this is set to true then to close the connection 

-     * requires an explicit call to SmtpClose(). 

-     * @var bool

-     */

-    var $SMTPKeepAlive = false;

+	/**

+	 * Sets message type to HTML.

+	 * @param bool $bool

+	 * @return void

+	 */

+	function IsHTML($bool) {

+		if($bool == true)

+		$this->ContentType = "text/html";

+		else

+		$this->ContentType = "text/plain";

+	}

 

-    /**#@+

-     * @access private

-     */

-    var $smtp            = NULL;

-    var $to              = array();

-    var $cc              = array();

-    var $bcc             = array();

-    var $ReplyTo         = array();

-    var $attachment      = array();

-    var $CustomHeader    = array();

-    var $message_type    = "";

-    var $boundary        = array();

-    var $language        = array();

-    var $error_count     = 0;

-    var $LE              = "\n";

-    /**#@-*/

-    

-    /////////////////////////////////////////////////

-    // VARIABLE METHODS

-    /////////////////////////////////////////////////

+	/**

+	 * Sets Mailer to send message using SMTP.

+	 * @return void

+	 */

+	function IsSMTP() {

+		$this->Mailer = "smtp";

+	}

 

-    /**

-     * Sets message type to HTML.  

-     * @param bool $bool

-     * @return void

-     */

-    function IsHTML($bool) {

-        if($bool == true)

-            $this->ContentType = "text/html";

-        else

-            $this->ContentType = "text/plain";

-    }

+	/**

+	 * Sets Mailer to send message using PHP mail() function.

+	 * @return void

+	 */

+	function IsMail() {

+		$this->Mailer = "mail";

+	}

 

-    /**

-     * Sets Mailer to send message using SMTP.

-     * @return void

-     */

-    function IsSMTP() {

-        $this->Mailer = "smtp";

-    }

+	/**

+	 * Sets Mailer to send message using the $Sendmail program.

+	 * @return void

+	 */

+	function IsSendmail() {

+		$this->Mailer = "sendmail";

+	}

 

-    /**

-     * Sets Mailer to send message using PHP mail() function.

-     * @return void

-     */

-    function IsMail() {

-        $this->Mailer = "mail";

-    }

+	/**

+	 * Sets Mailer to send message using the qmail MTA.

+	 * @return void

+	 */

+	function IsQmail() {

+		$this->Sendmail = "/var/qmail/bin/sendmail";

+		$this->Mailer = "sendmail";

+	}

 

-    /**

-     * Sets Mailer to send message using the $Sendmail program.

-     * @return void

-     */

-    function IsSendmail() {

-        $this->Mailer = "sendmail";

-    }

 

-    /**

-     * Sets Mailer to send message using the qmail MTA. 

-     * @return void

-     */

-    function IsQmail() {

-        $this->Sendmail = "/var/qmail/bin/sendmail";

-        $this->Mailer = "sendmail";

-    }

+	/////////////////////////////////////////////////

+	// RECIPIENT METHODS

+	/////////////////////////////////////////////////

 

+	/**

+	 * Adds a "To" address.

+	 * @param string $address

+	 * @param string $name

+	 * @return void

+	 */

+	function AddAddress($address, $name = "") {

+		$cur = count($this->to);

+		$this->to[$cur][0] = trim($address);

+		$this->to[$cur][1] = $name;

+	}

 

-    /////////////////////////////////////////////////

-    // RECIPIENT METHODS

-    /////////////////////////////////////////////////

+	/**

+	 * Adds a "Cc" address. Note: this function works

+	 * with the SMTP mailer on win32, not with the "mail"

+	 * mailer.

+	 * @param string $address

+	 * @param string $name

+	 * @return void

+	 */

+	function AddCC($address, $name = "") {

+		$cur = count($this->cc);

+		$this->cc[$cur][0] = trim($address);

+		$this->cc[$cur][1] = $name;

+	}

 

-    /**

-     * Adds a "To" address.  

-     * @param string $address

-     * @param string $name


      
avatar
Date: 2008-09-16 22:21
Posted By: Robert Sherby (alpicola)

Ravith,

Your patch there appears to have a lot of "noise" caused by a change in the use
of whitespace between your revisions and the original module.  I assume this was
done automatically by your text editor/IDE in order to make it easier for you to
edit the file.  Trouble is, all of the whitespace changes clutter the patch,
making it impossible to tell at a glance what the patch was actually meant to
change.  Would you mind re-issuing your patch with only the changes required to
activate (and provide an interface for) SSL?
      
avatar
Date: 2008-09-17 00:01
Posted By: Ravith Botejue (ravithb)

Hello Robert,

I just looked at the patch by alpicola and changed the code accordingly in the
newest version because I needed it in one of my projects. I did not intend to
generate a patch for this initially, but then just thought others may also find
it use ful and put the patch up. I intentionally indent code in my IDE, which
generated the noise in the patch.

Here is the patch without the noise. compatible with the lateset revision of
your SVN as at 0929hrs 17 Sept. 2008 GMT+5.30. ;)

Hope this will be there in the next major release of CMSMS. Patch is below. !


Index: CMSMailer.module.php
===================================================================
--- CMSMailer.module.php	(revision 24)
+++ CMSMailer.module.php	(working copy)
@@ -174,6 +174,7 @@
     $this->SetPreference('mailer', 'smtp');
     $this->SetPreference('host', 'localhost');
     $this->SetPreference('port', 25 );
+	$this->SetPreference('protocol', '');
     $this->SetPreference('from', 'root@localhost');
     $this->SetPreference('fromuser', 'CMS Administrator');
     $this->SetPreference('sendmail', '/usr/sbin/sendmail');
@@ -219,6 +220,7 @@
     $this->RemovePreference('mailer');
     $this->RemovePreference('host');
     $this->RemovePreference('port');
+	$this->RemovePreference('protocol');
     $this->RemovePreference('from');
     $this->RemovePreference('fromuser');
     $this->RemovePreference('sendmail');
@@ -285,6 +287,7 @@
     $this->the_mailer->Timeout = $this->GetPreference('timeout');
     $this->the_mailer->Sendmail = $this->GetPreference('sendmail');
     $this->the_mailer->Port   = $this->GetPreference('port');
+	$this->the_mailer->Protocol = $this->GetPreference('protocol');
     $this->the_mailer->Mailer = $this->GetPreference('mailer');
     $this->the_mailer->FromName = $this->GetPreference('fromuser');
     $this->the_mailer->From = $this->GetPreference('from');
@@ -331,6 +334,11 @@
 	$this->SetPreference('port',$params['input_port']);
       }
 
+	if( isset( $params['input_protocol'] ) )
+	  {
+	$this->SetPreference('protocol',$params['input_protocol']);
+	  }
+
     if( isset( $params['input_from'] ) )
       {
 	$this->SetPreference('from',$params['input_from']);
@@ -591,6 +599,18 @@
     $this->the_mailer->Port = $txt;
   }
 
+  function GetProtocol()
+  {
+	$this->_load();
+	return $this->the_mailer->Protocol;
+  }
+
+  function SetProtocol( $txt )
+  {
+	$this->_load();
+	$this->the_mailer->Protocol = $txt;
+  }
+
   function GetPriority()
   {
     $this->_load();
Index: action.defaultadmin.php
===================================================================
--- action.defaultadmin.php	(revision 24)
+++ action.defaultadmin.php	(working copy)
@@ -58,6 +58,11 @@
 						  $this->GetPreference('port'),
 						  6, 8));
 
+	$this->smarty->assign('prompt_protocol', $this->Lang('protocol'));
+	$this->smarty->assign('info_protocol', $this->Lang('info_protocol'));
+	$this->smarty->assign('input_protocol',
+	$this->CreateInputRadioGroup( $id, 'input_protocol',Array(
$this->Lang('protocol_none') => '',$this->Lang('protocol_ssl') =>
'ssl',$this->Lang('protocol_tls') => 'tls' ),$this->GetPreference('protocol')
));
+
     $this->smarty->assign('prompt_from', $this->Lang('from'));
     $this->smarty->assign('info_from', $this->Lang('info_from'));
     $this->smarty->assign('input_from',
Index: lang/en_US.php
===================================================================
--- lang/en_US.php	(revision 24)
+++ lang/en_US.php	(working copy)
@@ -15,6 +15,7 @@
 $lang['mailer']   = 'Mailer method';
 $lang['host']     = 'SMTP host name<br/><i>(or IP address)</i>';
 $lang['port']     = 'Port of SMTP server';
+$lang['protocol'] = 'Use encryption protocol';
 $lang['from']     = 'From address';
 $lang['fromuser'] = 'From Username';
 $lang['sendmail'] = 'Sendmail location';
@@ -24,6 +25,7 @@
$lang['info_mailer'] = 'Mail method to use (sendmail, smtp, mail).  Usually
smtp is the most reliable.';
 $lang['info_host'] = 'SMTP hostname (only valid for the smtp mailer method)';
$lang['info_port'] = 'SMTP port number (usually 25) (only valid for the smtp
mailer method)';
+$lang['info_protocol'] = 'Encryption method to use (none, ssl, tls). SSL and
TLS usually require setting the port to 465.';
$lang['info_from'] = 'Address used as the sender in all emails.
<br/><strong>Note</strong>, this email address must be set correctly for your
host or you will have difficulty sending emails.<br/>If you do not know the
proper value for this setting, you may need to contact your host.';
 $lang['info_fromuser'] = 'Friendly name used for sending all emails';
$lang['info_sendmail'] = 'The complete path to your sendmail executable (only
valid for the sendmail mailer method)';
@@ -317,4 +319,8 @@
<p>Copyright &copy; 2005, Robert Campbell <a
href=\'mailto:calguy1000@hotmail.com\'>&lt;calguy1000@hotmail.com&gt;</a>. All
Rights Are Reserved.</p>
<p>This module has been released under the <a
href=\'http://www.gnu.org/licenses/licenses.html#GPL\'>GNU Public License</a>.
You must agree to this license before using the module.</p>
 ';
+
+$lang['protocol_none'] = 'None';
+$lang['protocol_ssl']  = 'SSL';
+$lang['protocol_tls']  = 'TLS';
 ?>
Index: phpmailer/class.phpmailer.php
===================================================================
--- phpmailer/class.phpmailer.php	(revision 24)
+++ phpmailer/class.phpmailer.php	(working copy)
@@ -162,6 +162,12 @@
     var $Port        = 25;

 

     /**

+	 *  Sets the encryption protocol to use.
+	 *  @var string
+	 */
+	var $Protocol     = "";
+
+	/**

      *  Sets the SMTP HELO of the message (Default is $Hostname).

      *  @var string

      */

@@ -542,7 +548,7 @@
                 $port = $this->Port;

             }

 

-            if($this->smtp->Connect($host, $port, $this->Timeout))

+			if($this->smtp->Connect($host, $port, $this->Timeout, $this->Protocol))
             {

                 if ($this->Helo != '')

                     $this->smtp->Hello($this->Helo);

Index: phpmailer/class.smtp.php
===================================================================
--- phpmailer/class.smtp.php	(revision 24)
+++ phpmailer/class.smtp.php	(working copy)
@@ -79,7 +79,7 @@
      * @access public

      * @return bool

      */

-    function Connect($host,$port=0,$tval=30) {

+	function Connect($host,$port=0,$tval=30,$protocol="") {

         # set the error val to null so there is no confusion

         $this->error = null;

 

@@ -97,6 +97,10 @@
             $port = $this->SMTP_PORT;

         }

 

+		if(!empty($protocol)) {
+			$host = "$protocol://$host";
+		}
+		 

         #connect to the smtp server

         $this->smtp_conn = fsockopen($host,    # the host of the server

                                      $port,    # the port to use

Index: templates/prefs.tpl
===================================================================
--- templates/prefs.tpl	(revision 24)
+++ templates/prefs.tpl	(working copy)
@@ -18,6 +18,10 @@
 		<p class="pageinput">{$input_port}<br/>{$info_port}</p>
 	</div>
 	<div class="pageoverflow">
+	    <p class="pagetext">{$prompt_protocol}:</p>
+        <p class="pageinput">{$input_protocol}<br/>{$info_protocol}</p>
+   </div>
+   <div class="pageoverflow">
 		<p class="pagetext">{$prompt_from}:</p>
 		<p class="pageinput">{$input_from}<br/>{$info_from}</p>
 	</div>
      
avatar
Date: 2009-08-03 10:49
Posted By: Scott Zetlan (szetlan)

Bumping this.  Any update on successfully implementing this patch?  Have several
domains unable to send mail because the mail provider requires SSL connectivity.
      
avatar
Date: 2009-11-25 07:51
Posted By: Martin Hansen (Chinboy)

I've tried with the above patch, but get the following error in
CMSMailer-Control panel:

Fatal error: Call to a member function Lang() on a non-object in
/home/www/mydomain/tmp/templates_c/CMSMailer^%%E0^E04^E04946BC%%module_file_tpl%3ACMSMailer%3Bprefs.tpl.php
on line 5

I can't seem to figure out why though.

Line 5 in the above file, says:
<p><?php echo $this->_tpl_vars['mod']->Lang('info_cmsmailer'); ?>

Info:
CMSMS version 1.6.6
CMSMailer version 1.73.13


Thanks :)
      
avatar
Date: 2010-05-20 04:03
Posted By: Obaid B. (Atmey64)

It worked just fine :D
I just had to enable SSL from php.ini

Thanks Ravith 
      
Updates

Updated: 2010-05-20 09:53
resolution_id: => 7
state: Open => Closed