本文整理汇总了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();