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

PHP Mail\Message类代码示例

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

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



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

示例1: buyFormSucceeded

 public function buyFormSucceeded(\CustomForm $form, $values)
 {
     $product = $this->context->moduleSimpleEshopModel->getProduct($this->getParameter("id"), 1);
     $this->iModuleId = $product["page_page_modules_id"];
     $this->loadModuleFromDB();
     if ($form->isValid()) {
         $values["product_id"] = $product["id"];
         $values["product_title"] = $product["title"];
         $values["page_page_modules_id"] = $product["page_page_modules_id"];
         $order = $this->db->createOrder($values);
         if (!$order) {
             $this->flashMessage('Jejda. :( Něco je špatně. Zkuste znovu nebo se s námi spojte přímo. Děkujeme za pochopení.');
         } else {
             $mail = new Message();
             $mailer = new SendmailMailer();
             $emailHTML = $this->getEmailHTML($order, $product);
             // send confirmation email to customer
             $mail->setFrom($this->module->settings->email)->addTo($order->email)->setSubject('Potvrzení o koupi.')->setHTMLBody($emailHTML);
             $mailer->send($mail);
             // send confirmation email to owner of the eshop
             $mail->setFrom($this->module->settings->email)->addTo($this->module->settings->email)->setSubject('Potvrzení o koupi.')->setHTMLBody($emailHTML);
             $mailer->send($mail);
             $this->flashMessage($this->module->settings->order_confirmation, 'success');
         }
     } else {
         $this->flashMessage('Doplňte prosím všechny povinné položky.');
     }
     $this->redirect(":" . $this->getName() . ':Product', array('id' => $product['nice_url_segment'], 'moduleid' => $product['page_page_modules_id']));
 }
开发者ID:petrparolek,项目名称:web_cms,代码行数:29,代码来源:ModuleSimpleEshopPresenter.php


示例2: send

 /**
  * @param Mail\Message $mail
  */
 public function send(Mail\Message $mail)
 {
     $this->autoremove();
     list($sec) = explode(' ', substr(microtime(), 2));
     $this->lastFile = $this->path . date('Y-m-d_H-i-s-') . $sec . '.eml';
     file_put_contents($this->lastFile, $mail->generateMessage());
 }
开发者ID:h4kuna,项目名称:mail-manager,代码行数:10,代码来源:FileMailer.php


示例3: send

 public function send($from, $to, $subject, $template)
 {
     $mail = new Message();
     $mail->setFrom($from)->addTo($to)->setSubject($subject)->setHTMLBody($template);
     $mailer = new SendmailMailer();
     $mailer->send($mail);
 }
开发者ID:jaromir92,项目名称:Sportwin,代码行数:7,代码来源:MailSender.php


示例4: nette

 public function nette($from, $email, $subject, $content)
 {
     $mail = new Message();
     $mail->setFrom($from)->addTo($email)->setSubject($subject)->setHtmlBody($content);
     $mailer = new Nette\Mail\SmtpMailer(array('host' => getenv('NETTE_EMAIL_HOST') ?: '', 'smtp_port' => getenv('NETTE_EMAIL_PORT') ?: '25', 'username' => getenv('NETTE_EMAIL_USERNAME') ?: '', 'password' => getenv('NETTE_EMAIL_PASSWORD') ?: '', 'secure' => getenv('NETTE_EMAIL_SECURE') ?: 'ssl'));
     $mailer->send($mail);
 }
开发者ID:karyamedia,项目名称:karya,代码行数:7,代码来源:Email_Model.php


示例5: sendMailConsumer

 public function sendMailConsumer(\PhpAmqpLib\Message\AMQPMessage $message)
 {
     $sendMail = json_decode($message->body);
     $latte = new Latte\Engine();
     $sendMail->templateArr->email = $sendMail->to;
     $sendMail->templateArr->subject = $sendMail->subject;
     if (!is_null($sendMail->unsubscribeLink)) {
         $sendMail->templateArr->unsubscribeLink = $sendMail->unsubscribeLink;
     }
     $mail = new Nette\Mail\Message();
     $mail->setFrom($sendMail->from)->addTo($sendMail->to)->setHtmlBody($latte->renderToString($this->config["appDir"] . $this->config['mailer']['templateDir'] . (is_null($sendMail->template) ? $this->config['mailer']['defaultTemplate'] : $sendMail->template), (array) $sendMail->templateArr));
     if (!is_null($sendMail->unsubscribeEmail) || !is_null($sendMail->unsubscribeLink)) {
         $mail->setHeader('List-Unsubscribe', (!is_null($sendMail->unsubscribeEmail) ? '<mailto:' . $sendMail->unsubscribeEmail . '>' : '') . (!is_null($sendMail->unsubscribeEmail) && !is_null($sendMail->unsubscribeLink) ? ", " : "") . (!is_null($sendMail->unsubscribeLink) ? '<' . $sendMail->unsubscribeLink . '>' : ''), TRUE);
     }
     $mail->setSubject($sendMail->subject);
     try {
         $mailer = $this->emailFactory->getConnection($sendMail->connection);
         $mailer->send($mail);
         dump($sendMail->to);
         if ($sendMail->imapSave) {
             $this->saveToImap($mail->generateMessage(), is_null($sendMail->imapFolder) ? $this->config['imap']['sendFolder'] : $sendMail->imapFolder, $sendMail->imapConnection);
         }
         return TRUE;
     } catch (\Exception $e) {
         return FALSE;
     }
 }
开发者ID:trejjam,项目名称:emailing,代码行数:27,代码来源:Mailer.php


示例6: prepareMessage

 /**
  *
  * @return Message 
  */
 private function prepareMessage()
 {
     $message = new Message();
     $message->setFrom($this->from, $this->fromName);
     $message->setMailer($this->mailer);
     return $message;
 }
开发者ID:bazo,项目名称:translation-ui,代码行数:11,代码来源:MailBuilder.php


示例7: sendMail

 public function sendMail($formValues)
 {
     //        dump($formValues);
     //        die();
     //
     $template = new Nette\Templating\FileTemplate(__DIR__ . '/emailTemplates/' . $this->templateFilename);
     $template->registerFilter(new Nette\Latte\Engine());
     $template->registerHelperLoader('Nette\\Templating\\Helpers::loader');
     $attachments = array();
     if (isset($formValues['cv']) && $formValues['cv'] instanceof Nette\Http\FileUpload) {
         if ($formValues['cv']->isOk()) {
             $attachments[$formValues['cv']->getName()] = $formValues['cv']->getContents();
         }
     }
     unset($formValues['cv']);
     $template->values = $formValues;
     //        echo $template;
     //        die();
     $mail = new \Nette\Mail\Message();
     $mail->setFrom($this->from)->setSubject($this->subject)->addTo($this->to)->setHtmlBody($template);
     if ($attachments) {
         foreach ($attachments as $name => $content) {
             $mail->addAttachment($name, $content);
         }
     }
     //        foreach ($tos as $to) {
     //            $mail->addTo($to);
     //        }
     $mail->send();
 }
开发者ID:jurasm2,项目名称:bubo-sandbox,代码行数:30,代码来源:MailForm.php


示例8: composeMail

 private function composeMail($from, $to, $subject)
 {
     $this->mail = new Message();
     $this->mail->setFrom($from)->setSubject($subject);
     $this->processFromEmail($from)->processToEmail($to);
     return $this->mail;
 }
开发者ID:xruff,项目名称:apputils,代码行数:7,代码来源:Email.php


示例9: orderFormSucceeded

 function orderFormSucceeded(Form $form, $values)
 {
     $user = $this->findUser();
     $order = new Order($user);
     $order->setType($values->type);
     $order->setAmount($values->amount);
     $order->setName($values->name);
     $order->setPhone($values->phone);
     $order->setBusinessName($values->business_name);
     $order->setIc($values->ic);
     $order->setDic($values->dic);
     $order->setAddress($values->address);
     $order->setInvoiceAddress($values->invoice_address);
     $order->setShippingMethod($values->shipping_method);
     $order->setNote($values->note);
     $price_index = $values->type . '.price_per_unit';
     $order->setPricePerUnit(Settings::get($price_index));
     $this->em->persist($order);
     $this->em->flush();
     $order->createNum();
     $this->em->flush();
     $this->orderManager->invoice($order, true);
     $mail = new Message();
     $mail->setFrom(Settings::get('contact.name') . ' <' . Settings::get('contact.email') . '>')->addTo($order->getUser()->getEmail())->setSubject('Your order ' . $order->getNum())->setBody('You have placed a new order on kryo.mossbauer.cz. Please follow payment instructions in attachment.');
     $mail->addAttachment(WWW_DIR . '/../temp/' . $order->getInvoiceFileName());
     $this->mailer->send($mail);
     $this->flashMessage('Order has been successfully created!', 'success');
     $this->redirect('this');
 }
开发者ID:vitush93,项目名称:kryo,代码行数:29,代码来源:HomepagePresenter.php


示例10: send

 /**
  * @param string $senderEmail
  * @param string $recipientEmail
  * @param callable $templateCallback
  * @param array $param
  * @throws InvalidStateException
  */
 public function send($senderEmail, $recipientEmail, callable $templateCallback, array $param = [])
 {
     $template = $this->prepareTemplate($templateCallback, $param);
     $mail = new Message();
     $mail->setFrom($senderEmail)->addTo($recipientEmail)->setHtmlBody($template);
     $this->mailer->send($mail);
 }
开发者ID:blitzik,项目名称:vycetky,代码行数:14,代码来源:EmailNotifier.php


示例11: onFinish

 public function onFinish()
 {
     if (!count($this->messages)) {
         return;
     }
     // everything went alright
     $contents = implode(PHP_EOL, $this->messages) . PHP_EOL;
     // Only write the |$contents| to the file when this is not ran as part of a unit test.
     // Ideally we would verify that the write was successful, but there's no good fallback.
     if (!$this->isTest) {
         file_put_contents(self::ERROR_LOG, $contents, FILE_APPEND);
     }
     // Early-return if there are no failures, because there is no need to send an alert message
     // for successful service execution.
     if ($this->failures == 0) {
         return;
     }
     $configuration = Configuration::getInstance();
     // E-mail alerts can be disabled by the configuration, but force-enable them for tests.
     if (!$configuration->get('serviceLog/alerts') && !$this->isTest) {
         return;
     }
     // Compose an e-mail message for sending out an alert message. The recipients of this
     // message are defined in the main configuration file.
     $alert = new Message();
     $alert->setFrom($configuration->get('serviceLog/from'))->setSubject($configuration->get('serviceLog/subject'))->setBody($contents);
     foreach ($configuration->get('serviceLog/recipients') as $recipient) {
         $alert->addTo($recipient);
     }
     $this->mailer->send($alert);
 }
开发者ID:AnimeNL,项目名称:anime-2016,代码行数:31,代码来源:ServiceLogImpl.php


示例12: mail

 /**
  * 发送邮件
  */
 public function mail()
 {
     $mail = new Message();
     $mail->addTo("[email protected]");
     $mail->setSubject("hello world");
     $mailer = new \Nette\Mail\SmtpMailer(require BASE_PATH . "/config/mail.php");
     $mailer->send($mail);
 }
开发者ID:sky-L,项目名称:task,代码行数:11,代码来源:BaseAction.php


示例13: sendEmail

 public function sendEmail($from, $to, $template)
 {
     $mail = new Message();
     $mail->setFrom($from)->addTo($to)->setSubject($template->subject)->setHtmlBody($template->body);
     // dump($from); dump($to); dump($template); exit;
     $mailer = new SendmailMailer();
     $mailer->send($mail);
 }
开发者ID:bombush,项目名称:NatsuCon,代码行数:8,代码来源:EmailModel.php


示例14: notifyByEmail

 /**
  * @param int $id
  */
 public function notifyByEmail($id)
 {
     $ne = $this->getNotifyEmailById($id);
     $mail = new Message();
     $mail->setFrom("Wifimapa <[email protected]>")->addTo($ne["email"])->setSubject('Potvrzení získání dat')->setBody("Dobrý den,\ndata o která jste požádal byla získána do databáze.");
     $mailer = new SendmailMailer();
     $mailer->send($mail);
 }
开发者ID:romanvlcek,项目名称:wifimap,代码行数:11,代码来源:NotifyEmailService.php


示例15: sendBootstrap

 /**
  * @param string $email address
  * @param string $name
  * @throws Exception
  */
 public function sendBootstrap($email, $name)
 {
     $msg = new Message();
     $latte = new Engine();
     $args = ['email' => $msg];
     $html = $latte->renderToString($this->getTemplatePath('bootstrap'), $args);
     $msg->setFrom('[email protected]', 'Application Name')->addTo($email, $name)->setHtmlBody($html);
     $this->mailer->send($msg);
 }
开发者ID:Onset,项目名称:MangoPress,代码行数:14,代码来源:Mailer.php


示例16: createMessage

 /**
  * Mail message factory
  *
  * @return Nette\Mail\Message
  */
 protected function createMessage()
 {
     $message = new Nette\Mail\Message();
     // CLI
     if ($this->context->httpRequest->getUrl()->getHost() != "") {
         $message->setFrom('info@' . $this->context->httpRequest->getUrl()->getHost());
     }
     return $message;
 }
开发者ID:vbuilder,项目名称:framework,代码行数:14,代码来源:MailNotificator.php


示例17: send

 /**
  * Store mail to file.
  * @param  Message $message
  * @return int
  */
 public function send(Message $message)
 {
     $content = $message->generateMessage();
     preg_match('~Message-ID: <(?<message_id>\\w+)[^>]+>~', $content, $matches);
     $path = $this->tempDir . '/' . $this->prefix . $matches['message_id'] . '.' . self::FILE_EXTENSION;
     if (($bytes = file_put_contents($path, $content)) === FALSE) {
         throw new InvalidStateException("Unable to write email to '{$path}'.");
     }
     return $bytes;
 }
开发者ID:newPOPE,项目名称:FileMailer,代码行数:15,代码来源:FileMailer.php


示例18: processContactForm

 /**
  * Process contact form, send message
  * @param Form
  */
 public function processContactForm(Form $form)
 {
     $values = $form->getValues(TRUE);
     $message = new Message();
     $message->addTo('[email protected]')->setFrom($values['email'])->setSubject('Zpráva z kontaktního formuláře')->setBody($values['message']);
     $mailer = new SendmailMailer();
     $mailer->send($message);
     $this->flashMessage('Zpráva byla odeslána');
     $this->redirect('this');
 }
开发者ID:xHRo,项目名称:simpleForum,代码行数:14,代码来源:AdminPresenter.php


示例19: sendKontaktMail

 public function sendKontaktMail($clovekMail, $clovekName, $zprava, $spravci)
 {
     $mail = new Message();
     $mail->setFrom($this->mailerFromAddress)->setSubject('Nová zpráva z konktaktního formuláře webu SVJ Čiklova 647/3')->addReplyTo($clovekMail)->setBody($clovekName . " s emailem " . $clovekMail . " posílá následující dotaz: \n\n" . $zprava);
     foreach ($spravci as $address) {
         $mail->addTo($address);
     }
     $this->mailer->send($mail);
     return 1;
 }
开发者ID:bkralik,项目名称:BarakIS,代码行数:10,代码来源:DruzstvoMailer.php


示例20: emailFormSucceeded

 public function emailFormSucceeded(Form $form, $values)
 {
     $settings = $this->EntityManager->getRepository(Settings::getClassName());
     $setting = $settings->find(1);
     $mail = new Message();
     $mail->setFrom($values['email'])->addTo($setting->admin_email)->setSubject('Zpráva z webu PeTr - ' . $values['subject'])->setBody('Zpráva od ' . $values['name'] . '<br /><br />' . $values['message']);
     $mailer = new SendmailMailer();
     //$mailer->send($mail);
     $this->redirect('Contact:sent');
 }
开发者ID:B4rtosek,项目名称:sislak,代码行数:10,代码来源:ContactPresenter.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

专题导读
上一篇:
PHP PhpGenerator\ClassType类代码示例发布时间:2022-05-23
下一篇:
PHP Http\Url类代码示例发布时间: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