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


PHP emailer::send_mail方法代码示例

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


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

示例1: array

// set css classes for menue buttons
$classes = array("overview" => "overview", "msgs" => "msgs", "tasks" => "tasks", "miles" => "miles", "files" => "files", "users" => "users_active", "tracker" => "tracking");
$mainclasses = array("desktop" => "", "profil" => "active", "admin" => "");
$template->assign("mainclasses", $mainclasses);
$template->assign("classes", $classes);
if ($action == "loginerror") {
    $template->display("resetpassword.tpl");
} elseif ($action == "resetpassword") {
    $newpass = $user->resetPassword($email);
    if ($newpass !== false) {
        $langFile = readLangfile($newpass['locale']);
        $subject = $langfile["projectpasswordsubject"];
        $mailcontent = $langfile["hello"] . ",<br /><br/>" . $langfile["projectpasswordtext"] . "<br /><br />" . $langfile["newpass"] . ": " . $newpass['newpass'] . "<br />" . $langfile["login"] . ": <a href = \"{$url}\">{$url}</a>";
        // Send e-mail with new password
        $themail = new emailer($settings);
        $themail->send_mail($email, $subject, $mailcontent);
        $template->assign("success", 1);
        $template->display("resetpassword.tpl");
    } else {
        $template->assign("loginerror", 1);
        $template->display("resetpassword.tpl");
    }
} elseif ($action == "login") {
    $openid = getArrayVal($_POST, "openid");
    $username = getArrayVal($_POST, "username");
    $pass = getArrayVal($_POST, "pass");
    // Normal login
    if ($user->login($username, $pass)) {
        $loc = $url . "index.php?mode=login";
        header("Location: {$loc}");
    } else {
开发者ID:Setrino,项目名称:collabtive,代码行数:31,代码来源:manageuser.php

示例2: emailer

                    // assemble content only once. no need to do this repeatedly
                    $mailcontent = $userlang["hello"] . ",<br /><br/>" . $userlang["filecreatedtext"] . "<br /><br />" . $userlang["project"] . ": " . $pname["name"] . "<br />" . $userlang["folder"] . ": " . $whichfolder . "<br />" . $userlang["file"] . ":  <a href = \"" . $url . "managefile.php?action=downloadfile&file=" . $fileprops["ID"] . "\">" . $url . "managefile.php?action=downloadfile&file=" . $fileprops["ID"] . "</a>";
                    //$userlang["file"] . ":  <a href = \"" . $url . $fileprops["datei"] . "\">" . $url . $fileprops["datei"] . "</a>";
                    $subject = $userlang["filecreatedsubject"] . " (" . $userlang['by'] . ' ' . $username . ")";
                    //if sendto is an array multiple users need to be notified
                    if (is_array($sendto)) {
                        //check if the current user is in the notifications array
                        if (in_array($user["ID"], $sendto)) {
                            // send email
                            $themail = new emailer($settings);
                            $themail->send_mail($user["email"], $subject, $mailcontent);
                        }
                    } else {
                        // send email
                        $themail = new emailer($settings);
                        $themail->send_mail($user["email"], $subject, $mailcontent);
                    }
                }
            }
        }
    }
    $loc = $url .= "managefile.php?action=showproject&id={$id}&mode=added";
    // header("Location: $loc");
    echo "UPLOADED";
} elseif ($action == "editform") {
    if (!$userpermissions["files"]["edit"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "<h2>{$errtxt}</h2><br>{$noperm}");
        $template->display("error.tpl");
        die;
开发者ID:raum01,项目名称:Collabtive,代码行数:31,代码来源:managefile.php

示例3: die

    if (!$userpermissions["projects"]["edit"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "$errtxt<br>$noperm");
        $template->display("error.tpl");
        die();
    }
    if ($project->assign($user, $id)) {
        if ($settings["mailnotify"]) {
            $usr = (object) new user();
            $user = $usr->getProfile($user);

            if (!empty($user["email"])) {
                // send email
                $themail = new emailer($settings);
                $themail->send_mail($user["email"], $langfile["projectassignedsubject"] , $langfile["hello"] . ",<br /><br/>" . $langfile["projectassignedtext"] . " <a href = \"" . $url . "manageproject.php?action=showproject&id=$id\">" . $url . "manageproject.php?action=showproject&id=$id</a>");
            }
        }
        if ($redir) {
            $loc = $url . $redir;
        } else {
            $loc = $url . "manageuser.php?action=showproject&id=$id&mode=assigned";
        }
        header("Location: $loc");
    }
} elseif ($action == "deassignform") {
    if (!$userpermissions["projects"]["edit"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "$errtxt<br>$noperm");
        $template->display("error.tpl");
开发者ID:janvalentik,项目名称:Collabtive,代码行数:31,代码来源:manageproject.php

示例4: list

                 echo 'Сообщение игроку <b><font color=red>' . $komu[$i] . '</font></b> отправлено<br>';
                 list($send_pm_email, $email_komu, $send_ICQ, $ICQnumber, $ICQ_pm) = mysql_fetch_array(myquery("SELECT send_pm,email,send_ICQ,ICQnumber,ICQ_pm FROM game_users_data WHERE user_id={$userid}"));
                 if ($send_pm_email == 1) {
                     include "{$dirclass}/class_email.php";
                     $otkogo = $char['name'];
                     $message = "[http://" . domain_name . "] Средиземье :: Эпоха сражений. Письмо от {$otkogo}\n\n";
                     $message .= "Тема: {$theme}\n";
                     $message .= "Дата: " . date("H-i d-m-Y") . "\n";
                     $message .= "Содержание: \n{$post}\n";
                     $subject = 'Средиземье :: Эпоха сражений. Письмо от ' . $otkogo . '.';
                     $e_mail = new emailer();
                     $e_mail->email_init();
                     $e_mail->to = $email_komu;
                     $e_mail->subject = $subject;
                     $e_mail->message = $message;
                     $e_mail->send_mail();
                 }
             } else {
                 echo 'Игрока <b><font color=red>' . $komu[$i] . '</font></b> не существует!<br>';
             }
         }
     }
     echo '<meta http-equiv="refresh" content="3;url=act.php?func=pm&new">';
 } else {
     //Пишем письмо
     if (!isset($_GET['komu'])) {
         echo '<div id="content" onclick="hideSuggestions();">';
     }
     echo '<table width="100%" border="0" cellpadding="3">';
     echo '<tr><td></td><td>Чтобы написать сразу нескольким игрокам - напишите их имена через знак &quot;,&quot;</td><td></td></tr>';
     echo '<form action="" method="post"';
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:31,代码来源:pm.php

示例5: array

                $sendto = array();
            }
            foreach($users as $user) {
                if (!empty($user["email"])) {
                    if (is_array($sendto)) {
                        if (in_array($user["ID"], $sendto)) {
                            // check if subfolder exists, else root folder
                            $whichfolder = (!empty($thefolder)) ? $thefolder : $langfile["rootdir"];
                            // send email
                            $themail = new emailer($settings);
                            $themail->send_mail($user["email"], $langfile["filecreatedsubject"], $langfile["hello"] . ",<br /><br/>" . $langfile["filecreatedtext"] . "<br /><br />" . $langfile["project"] . ": " . $pname["name"] . "<br />" . $langfile["folder"] . ": " . $whichfolder . "<br />" . $langfile["file"] . ":  <a href = \"" . $url . $fileprops["datei"] . "\">" . $url . $fileprops["datei"] . "</a>");
                        }
                    } else {
                        // send email
                        $themail = new emailer($settings);
                        $themail->send_mail($user["email"], $langfile["filecreatedsubject"], "");
                    }
                }
            }
        }
    }
    $loc = $url .= "managefile.php?action=showproject&id=$id&mode=added";
    //header("Location: $loc");
    echo "UPLOADED";
}
elseif ($action == "editform") {
    if (!$userpermissions["files"]["edit"]) {
        $errtxt = $langfile["nopermission"];
        $noperm = $langfile["accessdenied"];
        $template->assign("errortext", "<h2>$errtxt</h2><br>$noperm");
        $template->display("error.tpl");
开发者ID:janvalentik,项目名称:Collabtive,代码行数:31,代码来源:managefile.php

示例6: emailer

                if (!empty($user["email"]))
                {
                    if (is_array($sendto))
                    {
                        if (in_array($user["ID"], $sendto))
                        {
                            // send email
                            $themail = new emailer($settings);
							$themail->send_mail($user["email"], $langfile["messagewasaddedsubject"], $langfile["hello"] . ",<br /><br/>" . $langfile["messagewasaddedtext"] . "<br /><br />" . $message . "<br /><br /><a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">$title</a>");
                        }
                    }
                    else
                    {
                        // send email
                        $themail = new emailer($settings);
						$themail->send_mail($user["email"], $langfile["messagewasaddedsubject"], $langfile["hello"] . ",<br /><br/>" . $langfile["messagewasaddedtext"] . "<br /><br />". $message . "<br /><br /><a href = \"" . $url . "managemessage.php?action=showmessage&id=$id&mid=$themsg\">$title</a>");
                    }
                }
            }
        }
        
        $loc = $url . "managemessage.php?action=showmessage&mid=$mid_post&id=$id&mode=replied";
        header("Location: $loc");
    }
} elseif ($action == "mymsgs")
{
    // create new project and file objects
    $project = new project();
    $myfile = new datei();
    // get all uof the users projects
    $myprojects = $project->getMyProjects($userid);
开发者ID:janvalentik,项目名称:Collabtive,代码行数:31,代码来源:managemessage.php

示例7: elseif

        } else {
            echo "ok";
        }
    } else {
        $template->assign("closetask", 0);
    }
} elseif ($action == "assign") {
    if ($task->assign($id, $user)) {
        if ($settings["mailnotify"]) {
            $usr = (object) new user();
            $user = $usr->getProfile($user);

            if (!empty($user["email"])) {
                // send email
                $themail = new emailer($settings);
                $themail->send_mail($user["email"], $langfile["taskassignedsubject"] , $langfile["hello"] . ",<br /><br/>" . $langfile["taskassignedtext"] . " <a href = \"" . $url . "managetask.php?action=showtask&id=$id&tid=$tid\">$title</a>");
            }
        }
        $template->assign("assigntask", 1);
        $template->display("mytasks.tpl");
    } else {
        $template->assign("assigntask", 0);
    }
} elseif ($action == "deassign") {
    if ($task->deassign($id, $user)) {
        $template->assign("deassigntask", 1);
        $template->display("mytasks.tpl");
    } else {
        $template->assign("deassigntask", 0);
    }
} elseif ($action == "showproject") {
开发者ID:janvalentik,项目名称:Collabtive,代码行数:31,代码来源:managetask.php

示例8: array

$mainclasses = array("desktop" => "",
    "profil" => "active",
    "admin" => ""
    );
$template->assign("mainclasses", $mainclasses);
$template->assign("classes", $classes);

if ($action == "loginerror") {
    $template->display("resetpassword.tpl");
} elseif ($action == "resetpassword") {
    $newpass = $user->resetPassword($email);
    if ($newpass != "") {
        // Send e-mail with new password
        $themail = new emailer($settings);
        $themail->send_mail($email, $langfile["projectpasswordsubject"], $langfile["hello"] . ",<br /><br/>" . $langfile["projectpasswordtext"] . "<br /><br />" . $langfile["newpass"] . ": " . "$newpass<br />" . $langfile["login"] . ": <a href = \"$url\">$url</a>");

        $template->assign("success", 1);
        $template->display("resetpassword.tpl");
    } else {
        $template->assign("loginerror", 1);
        $template->display("resetpassword.tpl");
    }
} elseif ($action == "login") {
    $mode = getArrayVal($_GET, "openid_mode");
    $username = getArrayVal($_POST, "username");
    $pass = getArrayVal($_POST, "pass");
    // normal login
    if ($user->login($username, $pass)) {
        $loc = $url . "index.php?mode=login";
        header("Location: $loc");
开发者ID:janvalentik,项目名称:Collabtive,代码行数:30,代码来源:manageuser.php

示例9: EndRegistration


//.........这里部分代码省略.........
        $exp1 = $row["exp"];
        $invite = 0;
        if (isset($uid) and $uid != '') {
            $uid = (int) $uid;
            $u = myquery("SELECT name FROM game_users WHERE user_id='{$uid}'");
            if (!mysql_num_rows($u)) {
                $u = myquery("SELECT name FROM game_users_archive WHERE user_id='{$uid}'");
            }
            $sel = myquery("SELECT host FROM game_users_active WHERE user_id='{$uid}'");
            if ($sel != false and mysql_num_rows($sel) > 0) {
                $host_p = mysql_result($sel, 0, 0);
            } else {
                $host_p = "";
            }
            list($name_p) = mysql_fetch_array($u);
            $user_host_p = HostIdentify();
            if ($uid > 0 and $user_host_p != $host_p) {
                $gp1 = $row["gp"] + 100;
                $invite = 1;
            } else {
                $gp1 = $row["gp"];
            }
        } else {
            $gp1 = $row["gp"];
        }
        $str1 = $row["str"];
        $ntl1 = $row["ntl"];
        $pie1 = $row["pie"];
        $vit1 = $row["vit"];
        $dex1 = $row["dex"];
        $spd1 = $row["spd"];
        //$lucky1=$row["lucky"];
        //$vospr1=$row["vospr"];
        //$magic_res1=$row["magic_res"];
        $avatar = $row["race"];
        $start_map_name = $row["map_name"];
        $start_map_x = $row["map_x"];
        $start_map_y = $row["map_y"];
        $avatar = $avatar . '_' . $sex . '.gif';
        $user_pass = generate_password(10);
        $result = myquery("\n\t\t\tINSERT game_users SET\n\t\t\tuser_name='{$user_name}',\n\t\t\tuser_pass='" . md5($user_pass) . "',\n\t\t\tname='{$name}',\n\t\t\tHP='{$hp1}',\n\t\t\tHP_MAX='{$hp_max1}',\n\t\t\tHP_MAXX='{$hp_max1}',\n\t\t\tMP='{$mp1}',\n\t\t\tMP_MAX='{$mp_max1}',\n\t\t\tSTM='{$stm1}',\n\t\t\tSTM_MAX='{$stm_max1}',\n\t\t\tEXP='{$exp1}',\n\t\t\tGP='{$gp1}',\n\t\t\tSTR='{$str1}',\n\t\t\tNTL='{$ntl1}',\n\t\t\tPIE='{$pie1}',\n\t\t\tVIT='{$vit1}',\n\t\t\tDEX='{$dex1}',\n\t\t\tSPD='{$spd1}',\n\t\t\tSTR_MAX='{$str1}',\n\t\t\tNTL_MAX='{$ntl1}',\n\t\t\tPIE_MAX='{$pie1}',\n\t\t\tVIT_MAX='{$vit1}',\n\t\t\tDEX_MAX='{$dex1}',\n\t\t\tSPD_MAX='{$spd1}',\n\t\t\tCW='" . $gp1 * money_weight . "',\n\t\t\tCC=40,\n\t\t\trace=" . $row['id'] . ",\n\t\t\tavatar='{$avatar}'\n\t\t\t") or die('Database Error: ' . mysql_error() . '<br>');
        $newuserid = mysql_insert_id();
        setGP($newuserid, $gp1, 4);
        if ($invite == 1) {
            myquery("INSERT INTO game_invite (user_id,invite_id,invite_regtime) VALUES ({$uid},{$newuserid}," . time() . ")");
        }
        //lucky='$lucky1',
        //lucky_max='$lucky1',
        //vospr='$vospr1',
        //vospr_max='$vospr1',
        //magic_res='$magic_res1',
        //magic_res_max='$magic_res1',
        //$result = myquery("DELETE FROM game_users_reg WHERE user_name = '$user_name'");
        $sel_uid = myquery("SELECT user_id FROM game_users WHERE user_name='{$user_name}'");
        list($uid) = mysql_fetch_array($sel_uid);
        $result = myquery("\n\t\t\tINSERT game_users_map SET\n\t\t\tuser_id='{$uid}',\n\t\t\tmap_name='{$start_map_name}',\n\t\t\tmap_xpos='{$start_map_x}',\n\t\t\tmap_ypos='{$start_map_y}'\n\t\t\t") or die('Database Error: ' . mysql_error() . '<br>');
        $result = myquery("\n\t\t\tINSERT game_users_data SET\n\t\t\tuser_id='{$uid}',\n\t\t\temail='{$email}',\n\t\t\tstatus='{$status}',\n\t\t\tgorod='{$gorod}',\n\t\t\thobbi='{$hobbi}',\n\t\t\tinfo='{$info}',\n\t\t\tdr_date='{$dn}',\n\t\t\tdr_month='{$ms}',\n\t\t\tdr_year='{$god}',\n\t\t\tsex='{$sex}',\n\t\t\trego_time='{$user_time}'\n\t\t\t") or die('Database Error: ' . mysql_error() . '<br>');
        myquery("INSERT INTO game_users_active (user_id,host,last_active) VALUES ('{$uid}','" . HostIdentify() . "','')");
        myquery("INSERT INTO game_users_active_host (user_id,host_more) VALUES ('{$uid}','" . HostIdentifyMore() . "')");
        myquery("INSERT INTO game_chat_option (user_id,ref,size,frame) VALUES ('{$uid}','1','13','250')");
        $message = "Привет, {$name}!\n\n";
        $message .= "Вы зарегистрировались в ролевой онлайн игре Средиземье :: Эпоха сражений\n\n";
        $message .= "Ваши данные:\n";
        $message .= "Логин: {$user_name}\n";
        $message .= "Пароль: {$user_pass}\n\n";
        $subject = 'Средиземье :: Эпоха сражений - ' . domain_name . '';
        $e_mail = new emailer();
        $e_mail->email_init();
        $e_mail->to = $email;
        $e_mail->subject = $subject;
        $e_mail->message = $message;
        $e_mail->send_mail();
        echo '<br>Спасибо за регистрацию<br><br>
		Теперь Вы можете войти в наш мир! <br>Пусть не за горами будет тот день, когда все Средиземье будет содрогаться от звука Вашего имени!<br>
			<br><br><a href="' . $_SERVER['PHP_SELF'] . '">На главную страницу</a>';
    } else {
        $error_msg = 'Ошибка: ' . $error_msg . '<br><br><a href="' . $_SERVER['PHP_SELF'] . '?option=register">Назад</a>';
        echo $error_msg;
    }
    echo '</td>
	<td  width="5" height="50" background="http://' . img_domain . '/nav/1_15.jpg"></td>
	</tr>
	<tr>
	<td width="5"><img src="http://' . img_domain . '/nav/1_19.jpg" width="5" height="8"></td>
	<td background="http://' . img_domain . '/nav/1_20.jpg"></td>
	<td><img src="http://' . img_domain . '/nav/1_22.jpg" width="7" height="8">
	</td>
	</tr>
	</table>
	</div>
	</td>
	<td width="10" background="http://' . img_domain . '/nav/333_17.jpg">&nbsp;</td>
	</tr>
	<tr>
	<td width="15"><img src="http://' . img_domain . '/nav/1_23.jpg" width="15" height="14"></td>
	<td colspan="3" background="http://' . img_domain . '/nav/1_25.jpg"></td>
	<td><img src="http://' . img_domain . '/nav/1_26.jpg" width="15" height="14"></td>
	</tr>
	</table>';
}
开发者ID:themiddleearth,项目名称:RPG.SU,代码行数:101,代码来源:index.php


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