当前位置: 首页>>代码示例>>PHP>>正文


PHP Mailer::addUserAddress方法代码示例

本文整理汇总了PHP中Mailer::addUserAddress方法的典型用法代码示例。如果您正苦于以下问题:PHP Mailer::addUserAddress方法的具体用法?PHP Mailer::addUserAddress怎么用?PHP Mailer::addUserAddress使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Mailer的用法示例。


在下文中一共展示了Mailer::addUserAddress方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: actionPerform

 function actionPerform(&$skin, $moduleID)
 {
     $recordSet = $skin->main->databaseConnection->Execute("SELECT user_groups.* , COUNT(users.name) AS user_count \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tFROM\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{$skin->main->databaseTablePrefix}user_groups AS user_groups LEFT OUTER JOIN\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t{$skin->main->databaseTablePrefix}users AS users\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tON\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tuser_groups.user_group_id = users.user_group_id\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tuser_groups.user_group_id>1\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tGROUP BY\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tuser_groups.user_group_id");
     //Check for error, if an error occured then report that error
     if (!$recordSet) {
         trigger_error("Unable to get user list\nreason is : " . $skin->main->databaseConnection->ErrorMsg());
     } else {
         $rows = $recordSet->GetRows();
         $skin->main->controlVariables["sendMessage"]['groupList'] = $rows;
         $skin->main->controlVariables["sendMessage"]['moduleId'] = $this->getModuleID($skin->main);
     }
     $skin->main->controlVariables["sendMessage"]['errorInfo'] = "";
     $skin->main->controlVariables["sendMessage"]['succeed'] = false;
     if (isset($_POST["event"]) && $_POST["event"] == 'sendMessage') {
         $mailer = new Mailer($skin->main);
         for ($i = 0; $i < sizeof($_POST["groups"]); $i++) {
             $recordSet = $skin->main->databaseConnection->Execute("SELECT username FROM {$skin->main->databaseTablePrefix}users AS users WHERE user_group_id=" . $_POST['groups'][$i]);
             if (!$recordSet) {
                 trigger_error("Unable to get group members\nreason is : " . $skin->main->databaseConnection->ErrorMsg());
                 return "";
             } else {
                 $rows = $recordSet->GetRows();
                 for ($j = 0; $j < sizeof($rows); $j++) {
                     $mailer->addUserAddress($rows[$j]["username"]);
                 }
             }
         }
         $mailer->Subject = $_POST["subject"];
         $mailer->Body = $_POST["content"];
         $mailer->Send();
         $skin->main->controlVariables["sendMessage"]['errorInfo'] = $mailer->ErrorInfo;
         $skin->main->controlVariables["sendMessage"]['succeed'] = $mailer->ErrorInfo == "";
     }
 }
开发者ID:BackupTheBerlios,项目名称:alumni-online-svn,代码行数:34,代码来源:sendMessage.php

示例2: actionPerform

 function actionPerform(&$skin, $moduleID)
 {
     $recordSet = $skin->main->databaseConnection->Execute("SELECT * FROM {$skin->main->databaseTablePrefix}users");
     //Check for error, if an error occured then report that error
     if (!$recordSet) {
         trigger_error("Unable to get user list\nreason is : " . $skin->main->databaseConnection->ErrorMsg());
     } else {
         $rows = $recordSet->GetRows();
         $skin->main->controlVariables["sendMessage"]['userList'] = $rows;
         $skin->main->controlVariables["sendMessage"]['moduleId'] = $this->getModuleID($skin->main);
     }
     $skin->main->controlVariables["sendMessage"]['errorInfo'] = "";
     $skin->main->controlVariables["sendMessage"]['succeed'] = false;
     if (isset($_POST["event"]) && $_POST["event"] == 'sendMessage') {
         $mailer = new Mailer($skin->main);
         for ($i = 0; $i < sizeof($_POST["users"]); $i++) {
             $mailer->addUserAddress($_POST["users"][$i]);
         }
         $mailer->Subject = $_POST["subject"];
         $mailer->Body = $_POST["content"];
         $mailer->Send();
         $skin->main->controlVariables["sendMessage"]['errorInfo'] = $mailer->ErrorInfo;
         $skin->main->controlVariables["sendMessage"]['succeed'] = $mailer->ErrorInfo == "";
     }
 }
开发者ID:BackupTheBerlios,项目名称:alumni-online-svn,代码行数:25,代码来源:sendMessage.php

示例3: actionPerform

 function actionPerform(&$skin, $moduleID)
 {
     $username = $this->getUsername($skin->main);
     $skin->main->controlVariables["sendMessage2User"]['username'] = $username;
     $skin->main->controlVariables["sendMessage2User"]['errorInfo'] = "";
     $skin->main->controlVariables["sendMessage2User"]['succeed'] = false;
     if (isset($_POST["event"]) && $_POST["event"] == 'sendMessage2User' && $username != NULL) {
         $mailer = new Mailer($skin->main);
         $mailer->addUserAddress($username);
         $mailer->Subject = $_POST["subject"];
         $mailer->Body = $_POST["content"];
         $mailer->Send();
         $skin->main->controlVariables["sendMessage2User"]['errorInfo'] = $mailer->ErrorInfo;
         $skin->main->controlVariables["sendMessage2User"]['succeed'] = $mailer->ErrorInfo == "";
     }
 }
开发者ID:BackupTheBerlios,项目名称:alumni-online-svn,代码行数:16,代码来源:sendMessage2User.php

示例4: actionPerform

 function actionPerform(&$skin, $moduleID)
 {
     $usernameError = '';
     if (isset($_POST["event"]) && $_POST["event"] == 'forgetPassword') {
         //Check username
         //Inorder to avoid sql injection attacks both
         //should contains characters form a to z and/or numbers only
         if (isset($_POST["username"]) && (!$skin->main->checkString('[^a-zA-Z0-9]', $_POST["username"]) || $_POST["username"] == "")) {
             $usernameError = "Username must contains numbers and/or character from a to z only";
         } else {
             $query = "SELECT * FROM {$skin->main->databaseTablePrefix}users WHERE username=" . $skin->main->databaseConnection->qstr($_POST["username"]);
             $recordSet = $skin->main->databaseConnection->Execute($query);
             $password = $this->randomNumber();
             $record = array('password' => md5($password));
             //Start Update Transaction
             $skin->main->databaseConnection->StartTrans();
             $updateSQL = $skin->main->databaseConnection->GetUpdateSQL($recordSet, $record);
             $skin->main->databaseConnection->Execute($updateSQL);
             $recordSet2 = $skin->main->databaseConnection->Execute("SELECT * FROM {$skin->main->databaseTablePrefix}templates \r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tWHERE\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\ttype='mail'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tAND\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t(\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname = 'forgetPasswordSubject'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tOR\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\tname = 'forgetPasswordBody'\r\n\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t\t)");
             $templates = array('forgetPasswordSubject' => '', 'forgetPasswordBody' => '');
             while (!$recordSet2->EOF) {
                 $templates[$recordSet2->fields["name"]] = $recordSet2->fields["content"];
                 $recordSet2->MoveNext();
             }
             $mailer = new Mailer($skin->main);
             $mailTemplate = new MailTemplate($skin->main);
             $mailTemplate->assign('username', $_POST["username"]);
             $mailTemplate->assign('password', $password);
             $mailer->addUserAddress($_POST["username"]);
             $mailer->Subject = $mailTemplate->fetch('mail/forgetPasswordSubject');
             $mailer->Body = $mailTemplate->fetch('mail/forgetPasswordBody');
             $mailer->Send();
             if ($mailer->ErrorInfo) {
                 //Transaction failed
                 $skin->main->databaseConnection->FailTrans();
                 trigger_error("Unable to send password remind mail. Reason is : " . $mailer->ErrorInfo);
             }
             //Complete update transaction
             $skin->main->databaseConnection->CompleteTrans();
         }
     }
     //Assign codeBehind variables
     $skin->main->controlVariables["forgetPassword"] = array('usernameError' => $usernameError);
 }
开发者ID:BackupTheBerlios,项目名称:alumni-online-svn,代码行数:44,代码来源:forgetPassword.php


注:本文中的Mailer::addUserAddress方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。