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


PHP Email\Email类代码示例

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


在下文中一共展示了Email类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的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(['admin@dimanamacet.com' => 'Administrator dimanamacet.com'])->to('aansubarkah@gmail.com')->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 = 'xuan@bliss-interactive.com';
     $replyToEmail = "xuan@bliss-interactive.com";
     $replyToEmailName = 'Info';
     $fromEmail = "noreply@bliss-interactive.net";
     $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('cursocakephp@gmail.com');
     $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('any@gmail.com');
     $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(['netadmin@smt.ufrj.br' => 'Controle de Usuarios'])->emailFormat('html')->to($emails)->subject('Notificação SMT')->send('Favor manter seus dados atualizados.');
     $aviso = new Email('gmail');
     $aviso->from(['netadmin@smt.ufrj.br' => 'Controle de Usuarios'])->emailFormat('html')->to('suporte.intranetsmt@gmail.com')->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 = "contact@marketingconnex.com";
         //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(['gm@vgphotohunt.com' => '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 <anand@phpconsultant.co>
  * @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


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