[xoops-cvslog 5861] CVS update: xoops2jp/html/modules/legacy/lib/Mailer

Back to archive index

Minahito minah****@users*****
2006年 11月 15日 (水) 23:56:08 JST


Index: xoops2jp/html/modules/legacy/lib/Mailer/Mailer.php
diff -u /dev/null xoops2jp/html/modules/legacy/lib/Mailer/Mailer.php:1.1.2.1
--- /dev/null	Wed Nov 15 23:56:08 2006
+++ xoops2jp/html/modules/legacy/lib/Mailer/Mailer.php	Wed Nov 15 23:56:08 2006
@@ -0,0 +1,107 @@
+<?php
+/**
+ * @package Legacy
+ * @version $Id$
+ */
+
+/**
+ * This is an exmine class for mail.
+ */
+class Legacy_Mailer extends phpmailer
+{
+	/**
+	 * @type XCube_Delegate
+	 */
+	var $mConvertLocal = null;
+	
+	function Legacy_Mailer()
+	{
+		$this->mConvertLocal =& new XCube_Delegate();
+		$this->mConvertLocal->register('Legacy_Mailer.ConvertLocal');
+	}
+	
+	function prepare()
+	{
+		$root =& XCube_Root::getSingleton();
+		
+		$handler =& xoops_gethandler('config');
+		$xoopsMailerConfig =& $handler->getConfigByCat(XOOPS_CONF_MAILER);
+		$this->reset();
+		
+		if ($xoopsMailerConfig['form'] == '') {
+			$this->From = $root->mContext->mXoopsConfig['adminmail'];
+		}
+		else {
+			$this->From = $xoopsMailerConfig['from'];
+		}
+		
+		$this->Sender = $root->mContext->mXoopsConfig['adminmail'];
+		
+		$this->SetLanguage = LEGACY_MAIL_LANG;
+		$this->CharSet = LEGACY_MAIL_CHAR;
+		$this->Encoding = LEGACY_MAIL_ENCO;
+		
+		switch ($xoopsMailerConfig['mailmethod']) {
+			case 'smtpauth':
+				$this->IsSMTP();
+				$this->SMTPAuth = true;
+				$this->Host = implode(';', $xoopsMailerConfig['smtphost']);
+				$this->Username = $xoopsMailerConfig['smtpuser'];
+				$this->Password = $xoopsMailerConfig['smtppass'];
+				break;
+				
+			case 'smtp':
+				$this->IsSMTP();
+				$this->SMTPAuth = false;
+				$this->Host = implode(';', $xoopsMailerConfig['smtphost']);
+				break;
+				
+			case 'sendmail':
+				$this->IsSendmail();
+				$this->Sendmail = $xoopsMailerConfig['sendmailpath'];
+				break;
+		}
+		
+		return true;
+	}
+	
+	function setFrom($text)
+	{
+		$this->From = $text;
+	}
+	
+	function setFromname($text)
+	{
+		$this->FromName = $this->convertLocal($text, true);
+	}
+	
+	function setSubject($text)
+	{
+		$this->Subject = $this->convertLocal($text, true);
+	}
+  
+	function setBody($text)
+	{
+		$this->Body = $this->convertLocal($text);
+	}
+	
+	function setTo($add, $name)
+	{
+		$this->AddAddress($add, $this->convertLocal($name, true));
+	}
+	
+	function reset()
+	{
+		$this->ClearAllRecipients();
+		$this->Body = "";
+		$this->Subject = "";
+	}
+	
+	function convertLocal($text, $mime = false)
+	{
+		$this->mConvertLocal->call(new XCube_Ref($text), $mine);
+		return $text;
+	}
+}
+
+?>
Index: xoops2jp/html/modules/legacy/lib/Mailer/index.html
diff -u /dev/null xoops2jp/html/modules/legacy/lib/Mailer/index.html:1.1.2.1
--- /dev/null	Wed Nov 15 23:56:08 2006
+++ xoops2jp/html/modules/legacy/lib/Mailer/index.html	Wed Nov 15 23:56:08 2006
@@ -0,0 +1 @@
+ <script>history.go(-1);</script>
\ No newline at end of file


xoops-cvslog メーリングリストの案内
Back to archive index