本文整理汇总了PHP中email::sendMail方法的典型用法代码示例。如果您正苦于以下问题:PHP email::sendMail方法的具体用法?PHP email::sendMail怎么用?PHP email::sendMail使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类email
的用法示例。
在下文中一共展示了email::sendMail方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: Database
<?php
session_start();
require_once "../../classes/database.class.php";
require_once "../../classes/mail.class.php";
$con = new Database();
if ($_SESSION['uname'] != 'admin') {
header("Location:/views/loginwrong.html");
}
$query = "INSERT INTO Accounts VALUES('%s','%s','%s','%s','%s','')";
for ($i = 0; $i < 10; $i++) {
if (strlen($_POST["uname{$i}"]) == 0) {
break;
}
$passwd = substr(sha1(rand(1, 10000)), 0, 8);
$con->query(sprintf($query, mysql_escape_string($_POST["uname{$i}"]), mysql_escape_string($_POST["name{$i}"]), sha1($passwd), mysql_escape_string($_POST["project{$i}"]), mysql_escape_string($_POST["email{$i}"])));
$user = new email(1, $_POST["uname{$i}"], $passwd);
$user->sendMail($_POST["email{$i}"]);
$project = $_POST["project{$i}"];
mkdir("/var/www/repos/{$project}/", 0777);
mkdir("/var/www/repos/{$project}/{$project}/", 0777);
chdir("/var/www/repos/{$project}/");
exec("git init");
}
header("location:/admin/views/adminHome.php");
示例2: Database
<?php
session_start();
require_once "../classes/database.class.php";
require_once "../classes/mail.class.php";
$con = new Database();
if ($_GET['flag'] == 'branch') {
$mail = new email(2);
$reply = $con->query("SELECT email FROM Accounts WHERE projectName='{$_SESSION['projectName']}' AND projectName!=uname");
if ($reply != 0) {
while ($row = mysql_fetch_assoc($reply)) {
$mail->sendMail($row['email']);
}
}
header("location:/views/guide.php");
}
示例3: resendVerification
function resendVerification()
{
$verificationlink = substr(md5($ar['username'] . $ar['email']), 1, 25);
$sql = "update `users` set activation='" . $verificationlink . "' where userid='" . $_SESSION['vibes_userid'] . "'";
$this->query($sql);
$str = $objcommon->getTemplateFormat('emailverification');
$objconfig = new config();
$objuser = new user();
$to['name'] = $_SESSION['vibes_username'];
$to['email'] = $objuser->getUserEmailFromUserId($_SESSION['vibes_userid']);
$from['name'] = $objcommon->getConfigValue('email_verification_from_name');
$from['email'] = $objcommon->getConfigValue('email_verification_from_email');
$subject = $objcommon->getConfigValue('email_verification_subject');
$identifier['sitename'] = $objcommon->getConfigValue('sitename');
$identifier['link'] = '<a href="' . $objconfig->get_domain_path() . 'emailverification.php?linkid=' . $verificationlink . '">' . $objconfig->get_domain_path() . 'emailverification.php?linkid=' . $activationlink . '</a>';
$objemail = new email();
$objemail->sendMail($to, $from, $subject, $body, $identifier);
return true;
//echo $identifier['link'];
// exit();
}