本文整理汇总了PHP中SMTP::log方法的典型用法代码示例。如果您正苦于以下问题:PHP SMTP::log方法的具体用法?PHP SMTP::log怎么用?PHP SMTP::log使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类SMTP
的用法示例。
在下文中一共展示了SMTP::log方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: sendmail
/**
* adapter for SMTP
*
* @param string $subject
* @param string $content
* @param email $receiver
*
* @return string done or error message
*/
static function sendmail($subject, $content, $receiver)
{
$to_address = $receiver == "" ? f3()->get('inquiry_receiver') : $receiver;
$smtp = new \SMTP(f3()->get('smtp_host'), f3()->get('smtp_port'), 'SSL', f3()->get('smtp_account'), f3()->get('smtp_password'));
$smtp->set('From', '"' . f3()->get('smtp_name') . '" <' . f3()->get('smtp_account') . '>');
$smtp->set('To', '<' . $to_address . '>');
$smtp->set('Subject', $subject);
$smtp->set('Errors-to', '<' . f3()->get('smtp_account') . '>');
$smtp->set('Content-Type', 'text/html');
$sent = $smtp->send($content, TRUE);
$mylog = $smtp->log();
if ($sent) {
return 'Done';
} else {
return $mylog;
}
}
示例2: date
$user->load(array('email = :username LIMIT 0,1', ':username' => $username));
if ($user->dry()) {
$user->role = 'subscriber';
$user->created = date('Y-m-d H:i:s');
// Send email to Admin with the good news: a new user!
$smtp = new SMTP(SMTP_SERVER, SMTP_PORT, SMTP_PROTOCOL, SMTP_USERNAME, SMTP_PASSWORD);
$smtp->set('From', '"Do Not Forget Me" <' . ADMIN_EMAIL . '>');
$smtp->set('To', '<' . ADMIN_EMAIL . '>');
$smtp->set('Subject', 'Yay, New DNFM User : ' . $user_profile->displayName);
$smtp->set('Errors-to', '<' . ADMIN_EMAIL . '>');
$message = "On " . date('Y-m-d at H:i') . ", a new user subscribed to Do Not Forget Me!";
$message .= "\n\nname: " . $user_profile->displayName;
$message .= "\nemail: " . $user_profile->email;
$message .= "\n\n\nPop up the champaign!";
$sent = $smtp->send($message, TRUE);
$mylog = $smtp->log();
}
$user->email = $username;
if (!empty($user_profile->displayName)) {
$user->name = $user_profile->displayName;
}
if (!empty($user_profile->firstName)) {
$user->first = $user_profile->firstName;
}
if (!empty($user_profile->photoURL)) {
$user->image = $user_profile->photoURL;
}
$user->save();
$f3->set('SESSION.name', $user->name);
$f3->set('SESSION.id', $user->id);
$f3->set('SESSION.first', $user->first);