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


PHP SMTP::set方法代码示例

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


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

示例1: foreach

 /**
  * Return an instance of f3 \SMTP populated with application settings
  *
  * @param array $data
  * @return \SMTP
  */
 public static function &getMailer(array $data = []) : \SMTP
 {
     $f3 = \Base::instance();
     $smtp = new \SMTP($f3->get('email.host'), $f3->get('email.port'), $f3->get('email.scheme'), $f3->get('email.user'), $f3->get('email.pass'));
     $smtp->set('From', $f3->get('email.from'));
     // finally set other values like overrides
     foreach ($data as $k => $v) {
         $smtp->set($k, $v);
     }
     return $smtp;
 }
开发者ID:vijinho,项目名称:FFMVC,代码行数:17,代码来源:Mail.php

示例2: 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;
     }
 }
开发者ID:trevorpao,项目名称:f3cms,代码行数:26,代码来源:Sender.php

示例3: date

// then grab the user profile
try {
    $hybridauth = new Hybrid_Auth($hauth_config);
    $adapter = $hybridauth->authenticate($provider_name);
    $user_profile = $adapter->getUserProfile();
    $_SESSION['logged_in'] = 'ok';
    $username = $user_profile->email;
    $f3->set('SESSION.logged_in', 'ok');
    $user = new DB\SQL\Mapper($db, 'memos');
    $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)) {
开发者ID:pixeline,项目名称:Do-Not-Forget,代码行数:31,代码来源:auth-action.get.php

示例4: date

     echo '<pre>' . print_r($response, false) . '</pre>';
 } else {
     /**
      * It's all good. Go ahead with your application-specific authentication logic
      */
     $_SESSION['logged_in'] = 'ok';
     $username = $response['auth']['info']['email'];
     $f3->set('SESSION.logged_in', 'ok');
     $user = new DB\SQL\Mapper($db, 'memos');
     $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 : ' . $response['auth']['info']['name']);
         $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: " . $response['auth']['info']['name'];
         $message .= "\nemail: " . $response['auth']['info']['email'];
         $message .= "\n\n\nPop up the champaign!";
         $sent = $smtp->send($message, TRUE);
         $mylog = $smtp->log();
     }
     $user->email = $username;
     if (!empty($response['auth']['info']['name'])) {
         $user->name = $response['auth']['info']['name'];
     }
     if (!empty($response['auth']['info']['first_name'])) {
开发者ID:pixeline,项目名称:Do-Not-Forget,代码行数:31,代码来源:auth-action.get_opauth.php


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