• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    迪恩网络公众号

PHP Email\Email类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了PHP中Cake\Network\Email\Email的典型用法代码示例。如果您正苦于以下问题:PHP Email类的具体用法?PHP Email怎么用?PHP Email使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



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

示例1: invite

 /**
  * Index method
  *
  * @return void
  */
 public function invite($tournament_id, $product_id, $count_teams)
 {
     if ($this->request->is('post')) {
         foreach ($this->request->data['player'] as $i => $invites) {
             $email = new Email('korujafc');
             if ($this->request->data['player_status'][$i] == 'email') {
                 $about = '[KorujaFC] Você foi convidado para o KorujaFC!';
                 $message = '<img src="http://www.korujafc.com/img/logo.png" alt="logo">
                     <h3>Olá,</h3>
                     <p>Clique aqui e faça sua inscrição no site para participar do torneio:<a href="http://www.korujafc.com/products/payment/' . $product_id . '/' . $tournament_id . '">INSCREVER</a></p>
                     <spam><i>2016 / <a href="http://www.korujafc.com">KORUJAFC.COM</a></i></spam>';
                 $email->emailFormat('html')->to($invites)->subject($about)->send($message);
             } elseif ($this->request->data['player_status'][$i] == 'login') {
                 $about = '[KorujaFC] Você foi convidado para um torneio.';
                 $message = '<img src="http://www.korujafc.com/img/logo.png" alt="logo">
                     <h3>Olá, ' . $this->request->data['player'][$i] . '</h3>
                     <p>Clique aqui para participar do torneio:<a href="http://www.korujafc.com/products/payment/' . $tournament_id . '">INSCREVER</a></p>
                     <spam><i>2016 / <a href="http://www.korujafc.com">KORUJAFC.COM</a></i></spam>';
                 $email->emailFormat('html')->to($this->request->data['userEmail'][$i])->subject($about)->send($message);
             } elseif ($this->request->data['player_status'][$i] == 'free') {
                 $transactionsTable = TableRegistry::get('Transactions');
                 $transaction = $transactionsTable->newEntity();
                 $transaction->tournament_id = $tournament_id;
                 $transaction->product_id = $product_id;
                 $transaction->user_id = $this->request->data['userId'][$i];
                 $transactionsTable->save($transaction);
             }
         }
         $this->Flash->success('Invitations has been sended.');
         return $this->redirect(['controller' => 'Tournaments', 'action' => 'index', 1]);
     }
     $this->set('count_teams', $count_teams);
 }
开发者ID:albertoneto,项目名称:localhost,代码行数:38,代码来源:InviteusersController.php


示例2: emailToManager

 public function emailToManager()
 {
     //$this->out('Hello Manager');
     $email = new Email('default');
     $email->from(['[email protected]' => 'Administrator dimanamacet.com'])->to('[email protected]')->subject('Daily Activity')->send('Lorem Ipsum DOlor sit Amet');
     $this->out('Success');
 }
开发者ID:aansubarkah,项目名称:apimiminmacetdimana,代码行数:7,代码来源:ReportShell.php


示例3: sendMail

 public function sendMail()
 {
     $mailer = new Email();
     $mailer->transport('smtp');
     $email_to = '[email protected]';
     $replyToEmail = "[email protected]";
     $replyToEmailName = 'Info';
     $fromEmail = "[email protected]";
     $fromEmailName = "Xuan";
     $emailSubject = "Demo mail";
     //$view_link = Router::url('/', true);
     $params_name = 'XuanNguyen';
     $view_link = Router::url(['language' => $this->language, 'controller' => 'frontend', 'action' => 'view_email', 'confirmation', $params_name], true);
     $sentMailSatus = array();
     if (!empty($email_to)) {
         //emailFormat text, html or both.
         $mailer->template('content', 'template')->emailFormat('html')->subject($emailSubject)->viewVars(['data' => ['language' => $this->language, 'mail_template' => 'confirmation', 'email_vars' => ['view_link' => $view_link, 'name' => $params_name]]])->from([$fromEmail => $fromEmailName])->replyTo([$replyToEmail => $replyToEmailName])->to($email_to);
         if ($mailer->send()) {
             $sentMailSatus = 1;
         } else {
             $sentMailSatus = 0;
         }
     }
     pr($sentMailSatus);
     exit;
 }
开发者ID:hongtien510,项目名称:cakephp-routing,代码行数:26,代码来源:TemplateCodeController.php


示例4: send

 /**
  * send mail 
  * @param type $id
  * @param type $email
  * @param type $url
  * @param type $subject
  * @param type $body
  */
 public function send($id, $email, $url, $subject, $body)
 {
     $mail = new Email('default');
     $key = Configure::read('key.encrypt');
     $token = sha1($id . $key);
     $link = Router::url('/', true) . $url . '/' . $token;
     $mail->to($email)->subject($subject)->emailFormat("html")->send("<a href='" . $link . "'>" . $body . "<a>");
 }
开发者ID:phithienthan,项目名称:apptest,代码行数:16,代码来源:SendMail.php


示例5: _execute

 protected function _execute(array $data)
 {
     // aqui vai a lógica
     $email = new Email('gmail');
     $email->to('[email protected]');
     $email->subject('contato do sistema');
     $msg = "\n\t\t\t<b>De:</b> {$data['nome']}<br />\n\t\t\t<b>Email:</b> {$data['email']}<br />\n\t\t\t<b>msg:</b> {$data['msg']}<br />\n\t\t";
     return $email->send($msg);
 }
开发者ID:rsaggio,项目名称:curso-cakephp,代码行数:9,代码来源:ContactForm.php


示例6: _execute

 public function _execute(array $data)
 {
     $mensagem = sprintf('Contato feito pelo site <br>
         Nome: %s<br>
         Email: %s<br>
         Mensagem: %s', $data['nome'], $data['email'], $data['mensagem']);
     $email = new Email('gmail');
     $email->to('[email protected]');
     $email->subject('Contato');
     $email->emailFormat('html');
     return $email->send($mensagem);
 }
开发者ID:rafaelschn,项目名称:cake3lab,代码行数:12,代码来源:ContatoForm.php


示例7: dadosAtualizados

 public function dadosAtualizados()
 {
     $users = $ldap->getUsers("uid=*");
     $emails = array();
     foreach ($users as $user) {
         $email = $user['uid'][0] . '@smt.ufrj.br';
         array_push($emails, $email);
     }
     $email = new Email('gmail');
     $email->from(['[email protected]' => 'Controle de Usuarios'])->emailFormat('html')->to($emails)->subject('Notificação SMT')->send('Favor manter seus dados atualizados.');
     $aviso = new Email('gmail');
     $aviso->from(['[email protected]' => 'Controle de Usuarios'])->emailFormat('html')->to('[email protected]')->subject('JOB Realizado')->send('Job Dados Atualizados executado com sucesso.');
 }
开发者ID:gbauso,项目名称:asirb,代码行数:13,代码来源:NotificacaoController.php


示例8: userSignupEmail

 function userSignupEmail($event)
 {
     $this->emails = TableRegistry::get('Emails');
     $emailTemplate = $this->emails->find()->where(['Emails.code' => 'signup_email'])->first();
     $user = $event->data['user'];
     $emailAddress = $user->email;
     $params = ['%name%' => $user->name, '%email%' => $user->email];
     $subject = str_replace(array_keys($params), array_values($params), $emailTemplate->subject);
     $content = str_replace(array_keys($params), array_values($params), $emailTemplate->message);
     echo $emailAddress;
     $email = new Email('default');
     $email->emailFormat('both')->to($emailAddress)->subject($subject)->viewVars(['content' => $content])->send();
 }
开发者ID:hunnybohara,项目名称:coin_bates,代码行数:13,代码来源:EmailListener.php


示例9: sendMail

 /**
  * Check email in stack and send to user
  * @throws Exception
  * @return void
  */
 public function sendMail()
 {
     $mails = $this->EmailStacks->find()->where(['sent' => false]);
     $dataResult = [];
     foreach ($mails as $row) {
         $email = new Email('default');
         if ($email->to($row->email)->subject($row->subject)->send($row->content)) {
             $ent = $this->EmailStacks->get($row->id);
             $ent->sent = true;
             $this->EmailStacks->save($ent);
         }
     }
 }
开发者ID:nguyennghiem1205,项目名称:Wss,代码行数:18,代码来源:OneMinuteShell.php


示例10: _execute

 protected function _execute(array $data)
 {
     //print_r($data); exit;
     if (null != $data['email']) {
         $adminEmail = "[email protected]";
         //EMAIL THE Admin
         $subject = __('A new form submission been received from the MarketingConneX.com Challenges landing page');
         $email = new Email('default');
         $email->sender($data['email'], $data['firstname']);
         $email->from([$data['email'] => $data['firstname']])->to([$adminEmail => 'marketingconneX.com'])->subject($subject)->emailFormat('html')->template('landingpageform')->viewVars(array('firstname' => $data['firstname'], 'lastname' => $data['lastname'], 'email' => $data['email'], 'website' => $data['website'], 'phone' => $data['phone'], 'info' => $data['info'], 'landingpage' => $data['landingpage']))->send();
         return true;
     }
     return false;
 }
开发者ID:franky0930,项目名称:MarketingConnex,代码行数:14,代码来源:LandingPageForm.php


示例11: sendMail

 /**
  * Check email in stack and send to user
  * @throws Exception
  * @return void
  */
 public function sendMail()
 {
     $mails = $this->EmailStacks->find()->where(['sent' => false]);
     $dataResult = [];
     foreach ($mails as $row) {
         $email = new Email('default');
         if ($email->emailFormat('html')->template('content')->to($row->email)->subject($row->subject)->viewVars(['content' => $row->content])->send()) {
             $ent = $this->EmailStacks->get($row->id);
             $ent->sent = true;
             $this->EmailStacks->save($ent);
         }
     }
     return true;
 }
开发者ID:nguyennghiem1205,项目名称:japan-circle,代码行数:19,代码来源:OneMinuteShell.php


示例12: reminder

 public function reminder()
 {
     if ($this->request->is('post')) {
         $user = $this->Users->findByEmail($this->request->data['email'])->first();
         if ($user) {
             $email = new Email('default');
             $email->template('reminder', 'default')->to($user->email)->subject('Recuperação de Senha')->viewVars(['name' => $user->name, 'email' => $user->email, 'password' => (new LegacyPasswordHasher())->decode($user->password)])->send();
             unset($this->request->data['email']);
             $this->Flash->success(__('We sent an email to you. Open your inbox to check your password.'), ['key' => 'auth']);
         } else {
             $this->Flash->error(__('E-mail does not exist.'), ['key' => 'auth']);
         }
     }
 }
开发者ID:jorgejardim,项目名称:cakephp-skeleton-systems,代码行数:14,代码来源:UsersController.php


示例13: contact

 /**
  * Alari Contact
  */
 public function contact()
 {
     if ($this->request->is('post')) {
         //Send email to admin after saving the inquiry
         $data = [];
         $data['from'] = $this->request->data['FullName'];
         $data['email'] = $this->request->data['Email'];
         $data['message'] = $this->request->data['Message'];
         $email = new Email('default');
         $email->template('inquiry')->emailFormat('text')->subject('Inquiry')->to(OWNER_EMAIL)->viewVars($data)->send();
         $this->Flash->success('Your inquiry has been sent successfully.');
         return $this->redirect(['action' => 'contact']);
     }
 }
开发者ID:hkri,项目名称:alari,代码行数:17,代码来源:ContactController.php


示例14: resetPass

 public function resetPass($email)
 {
     if (!isset($email)) {
         return false;
     }
     $users = TableRegistry::get('Users');
     $user = $users->find()->where(['Users.email' => $email])->first();
     if (!isset($user)) {
         return false;
     }
     $msg = new Email();
     $msg->transport('default')->from(['[email protected]' => 'Game Master'])->to($user->email)->subject('VGPhotohunt - Reset Your Password')->template('resetPass')->viewVars(['token' => $user->confirmation_token, 'username' => $user->username])->send();
     return true;
 }
开发者ID:breakfastcerealkillr,项目名称:vgphotohunt,代码行数:14,代码来源:EmailsTable.php


示例15: send

 /**
  * 
  * @author Anand Thakkar <[email protected]>
  * @param Email $email
  * @throws \App\Network\Email\Mandrill_ErrorS
  */
 public function send(Email $email)
 {
     $headers = $email->getHeaders(['from', 'sender', 'replyTo', 'to', 'cc', 'bcc']);
     try {
         $message = array('html' => '<p>This is the body of the Email</p>', 'text' => 'This is the body of the Email', 'subject' => 'Testing mandrill Application', 'from_email' => $headers['From'], 'from_name' => $headers['Sender'], 'to' => array(array('email' => $headers['To'], 'type' => 'to')), 'headers' => array('Reply-To' => $headers['Reply-To']), 'important' => false);
         $async = false;
         $ip_pool = 'Main Pool';
         $send_at = FALSE;
         $result = $this->mandrill->messages->send($message, $async, $ip_pool, $send_at);
     } catch (Mandrill_Error $e) {
         echo 'A mandrill error occurred: ' . get_class($e) . ' - ' . $e->getMessage();
         //throw $e;
     }
 }
开发者ID:hunnybohara,项目名称:coin_bates,代码行数:20,代码来源:MandrillTransport.php


示例16: _execute

 protected function _execute(array $data)
 {
     //print_r($data); exit;
     if (null != $data['email']) {
         //SEND TO SALES FORCE
         //-----------------------------------
         //then bundle the request and send it to Salesforce.com
         $req = "&lead_source=" . "Web";
         $req .= "&first_name=" . $data['firstname'];
         $req .= "&last_name=" . $data['lastname'];
         $req .= "&company=" . $data['company'];
         $req .= "&00N20000009ZAQB=" . $data['position'];
         $req .= "&email=" . $data['email'];
         $req .= "&phone=" . $data['phone'];
         $req .= "&debug=" . urlencode("0");
         $req .= "&oid=" . urlencode("00D20000000ozqG");
         $req .= "&retURL=" . urlencode("http://qa.marketingconnex.com/pages/thank-you");
         $req .= "&debugEmail=" . urlencode("[email protected]");
         $header = "POST /servlet/servlet.WebToLead?encoding=UTF-8 HTTP/1.0\r\n";
         $header .= "Content-Type: application/x-www-form-urlencoded\r\n";
         $header .= "Host: www.salesforce.com\r\n";
         $header .= "Content-Length: " . strlen($req) . "\r\n\r\n";
         $fp = fsockopen('www.salesforce.com', 80, $errno, $errstr, 30);
         if (!$fp) {
             echo "No connection made";
         } else {
             fputs($fp, $header . $req);
             while (!feof($fp)) {
                 $res = fgets($fp, 1024);
                 //echo $res;
             }
         }
         fclose($fp);
         //-----------------------------------
         $adminEmail = "[email protected]";
         //EMAIL THE CUSTOMER
         $subject = __('Thank you for contacting MarketingConneX.com');
         $email = new Email('default');
         $email->sender($adminEmail, 'marketingconneX.com');
         $email->from([$adminEmail => 'marketingconneX.com'])->to([$data['email'] => $data['name']])->subject($subject)->emailFormat('html')->template('contactform', 'system')->viewVars(array('email_type' => 'customer', 'name' => $data['firstname'], 'company' => $data['company'], 'position' => $data['position'], 'email' => $data['email'], 'site_url' => 'http://www.marketingconnex.com', 'SITE_NAME' => 'MarketingConneX.com', 'phone' => $data['phone'], 'info' => $data['info'], 'message' => $data['message']))->send();
         //EMAIL THE Admin
         $subject = __('A new enquiry has been received on MarketingConneX.com');
         $email = new Email('default');
         $email->sender($adminEmail, 'marketingconneX.com');
         $email->from([$data['email'] => $data['name']])->to([$adminEmail => 'marketingconneX.com'])->subject($subject)->emailFormat('html')->template('contactform', 'system')->viewVars(array('email_type' => 'admin', 'name' => $data['firstname'], 'company' => $data['company'], 'position' => $data['position'], 'email' => $data['email'], 'site_url' => 'http://www.marketingconnex.com', 'SITE_NAME' => 'MarketingConneX.com', 'phone' => $data['phone'], 'info' => $data['info'], 'message' => $data['message']))->send();
         return true;
     }
     return false;
 }
开发者ID:franky0930,项目名称:MarketingConnex,代码行数:49,代码来源:ContactForm.php


示例17: requestPasswordReset

 public function requestPasswordReset()
 {
     $user = $this->Users->newEntity();
     if ($this->request->is('post')) {
         $user = $this->Users->patchEntity($user, $this->request->data, ['validate' => 'requestPasswordReset']);
         if (!$user->errors()) {
             $token = $this->Users->savePasswordToken($this->request->data['email']);
             $email = new Email('default');
             $email->viewVars(['token' => $token, 'name' => $user->name])->from(['[email protected]' => 'LifeSpark'])->to($user->email)->emailFormat('html')->template('password_reset')->subject('Wachtwoord veranderen op LifeSpark.nl');
             $this->Flash->success(__('An email has been send to {0}', [$this->request->data['email']]));
             return $this->redirect(['action' => 'login']);
         }
     }
     $this->set('user', $user);
 }
开发者ID:Jurrieb,项目名称:lifespark,代码行数:15,代码来源:UsersController.php


示例18: send

 /**
  * Send mail
  *
  * @param Email $email Email
  * @return array
  */
 public function send(Email $email)
 {
     if (!empty($this->_config['queue'])) {
         $this->_config = $this->_config['queue'] + $this->_config;
         $email->config((array) $this->_config['queue'] + ['queue' => []]);
         unset($this->_config['queue']);
     }
     $transport = $this->_config['transport'];
     $email->transport($transport);
     $QueuedTasks = TableRegistry::get('Queue.QueuedTasks');
     $result = $QueuedTasks->createJob('Email', ['transport' => $transport, 'settings' => $email]);
     $result['headers'] = '';
     $result['message'] = '';
     return $result;
 }
开发者ID:ameyrf,项目名称:cakephp-queue,代码行数:21,代码来源:QueueTransport.php


示例19: afterForgot

 public function afterForgot($event, $user)
 {
     $email = new Email('default');
     $email->viewVars(['user' => $user, 'resetUrl' => Router::fullBaseUrl() . Router::url(['prefix' => false, 'plugin' => 'Users', 'controller' => 'Users', 'action' => 'reset', $user['email'], $user['request_key']]), 'baseUrl' => Router::fullBaseUrl(), 'loginUrl' => Router::fullBaseUrl() . '/login']);
     $email->from(Configure::read('Users.email.from'));
     $email->subject(Configure::read('Users.email.afterForgot.subject'));
     $email->emailFormat('both');
     $email->transport(Configure::read('Users.email.transport'));
     $email->template('Users.afterForgot', 'Users.default');
     $email->to($user['email']);
     $email->send();
 }
开发者ID:hareshpatel1990,项目名称:cakephp-users,代码行数:12,代码来源:UsersMailer.php


示例20: send

 /**
  * 
  * @author Anand Thakkar <[email protected]>
  * @param Email $email
  * @throws \App\Network\Email\Mandrill_ErrorS
  */
 public function send(Email $email)
 {
     $headers = $email->getHeaders(['from', 'sender', 'replyTo', 'to', 'cc', 'bcc']);
     try {
         pr($email);
         die('we are here');
         $message = array('html' => '<p>Example HTML content</p>', 'text' => 'Example text content', 'subject' => 'example subject', 'from_email' => $headers['From'], 'from_name' => $headers['Sender'], 'to' => array(array('email' => $headers['To'], 'type' => 'to')), 'headers' => array('Reply-To' => $headers['Reply-To']), 'important' => false);
         $async = false;
         $ip_pool = 'Main Pool';
         $send_at = FALSE;
         $result = $this->mandrill->messages->send($message, $async, $ip_pool, $send_at);
     } catch (Mandrill_Error $e) {
         echo 'A mandrill error occurred: ' . get_class($e) . ' - ' . $e->getMessage();
         throw $e;
     }
 }
开发者ID:hunnybohara,项目名称:coin_bates,代码行数:22,代码来源:MandrillTransport.php



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
PHP ORM\Association类代码示例发布时间:2022-05-23
下一篇:
PHP Network\Session类代码示例发布时间:2022-05-23
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap