本文整理匯總了PHP中mail::set_subject方法的典型用法代碼示例。如果您正苦於以下問題:PHP mail::set_subject方法的具體用法?PHP mail::set_subject怎麽用?PHP mail::set_subject使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類mail
的用法示例。
在下文中一共展示了mail::set_subject方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: mail
function mail($verbose = 0)
{
$timestamp = strtotime('+1 day');
$this->date = date('Y-m-d', $timestamp);
if (!$this->load_schedule()) {
return false;
}
global $db;
$select = "CONCAT(first_name,' ',last_name) as name, mail\r\n FROM person\r\n WHERE opt&32=32";
$db->select($select);
$recipients = $db->data;
$mail = new mail();
$subject_v['date'] = local_date($this->date);
$subject = new tmpl('mail_subject.txt', $subject_v);
$mail->set_subject($subject->fdata);
$mail->data_main = $this->text;
$output = '';
foreach ($recipients as $i => $person) {
$name = $person['name'];
$mail->sendto($person['mail'], $name);
if ($mail->sent) {
$output .= '_';
} else {
$output .= 'X';
}
}
if ($verbose) {
echo $output;
}
return $output;
}
示例2: create
function create($text, $persons, $groups)
{
$data['text'] = $text;
$data['text_slashes'] = addslashes($text);
$data['created'] = date('Y-m-d H:i:s');
$data['author_first_name'] = $_SESSION['first_name'];
$data['author_last_name'] = $_SESSION['last_name'];
foreach ($groups as $id => $name) {
$group = new group($id);
foreach ($group->members as $i => $member) {
$persons[$member['member_id']] = $member;
}
}
foreach ($persons as $id => $arr) {
$person = new person();
$person->load($id);
$persons[$id] = $person->data;
}
$this->to = $persons;
$this->set_data($data);
}
function insert()
{
global $db;
$query = 'messages (author, created, text) values (
"' . $_SESSION['userid'] . '",
now(),
"' . $this->data['text_slashes'] . '"
)';
$db->insert($query);
$message_id = $db->insert_id;
$author = new person();