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

PHP Swift_SmtpTransport类代码示例

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

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



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

示例1: getErrors

 public function getErrors(Config $cfg)
 {
     $i18n = Localization::getTranslator();
     $walletSettings = [];
     $emailSettings = [];
     $providerClass = '';
     try {
         $provider = $cfg->getWalletProvider();
         $providerClass = get_class($provider);
         $provider->verifyOwnership();
     } catch (Exception $e) {
         if (strpos($providerClass, 'CoinbaseWallet') !== false) {
             $walletSettings[] = ['id' => '#wallet-coinbaseApiKey-error', 'error' => $e->getMessage()];
         } else {
             $walletSettings[] = ['id' => '#wallet-id-error', 'error' => $e->getMessage()];
         }
     }
     try {
         $t = new Swift_SmtpTransport('smtp.gmail.com', 465, 'ssl');
         $t->setUsername($cfg->getEmailUsername())->setPassword($cfg->getEmailPassword())->start();
     } catch (Exception $e) {
         $emailSettings[] = ['id' => '#email-username-error', 'error' => $e->getMessage()];
     }
     $errors = [];
     if (!empty($pricingSettings)) {
         $errors['#pricing-settings'] = self::getPricingErrorsFromConfig($cfg);
     }
     if (!empty($walletSettings)) {
         $errors['#wallet-settings'] = $walletSettings;
     }
     if (!empty($emailSettings)) {
         $errors['#email-settings'] = $emailSettings;
     }
     return $errors;
 }
开发者ID:kryptoc,项目名称:skyhook,代码行数:35,代码来源:ConfigVerifier.php


示例2: send

 public function send()
 {
     $smtpTransport = new \Swift_SmtpTransport($this->spoolMailerParam('host'), $this->spoolMailerParam('port'));
     $smtpTransport->setUsername($this->spoolMailerParam('username'));
     $smtpTransport->setPassword($this->spoolMailerParam('password'));
     $this->spool->flushQueue($smtpTransport);
 }
开发者ID:vodas,项目名称:praktykirepofinito,代码行数:7,代码来源:SpoolMailer.php


示例3: init

 /**
  * Initialize the component
  */
 public function init()
 {
     $this->initAutoloader($this->swiftBasePath);
     $this->transport = Swift_SmtpTransport::newInstance($this->host, $this->port, $this->security);
     $this->transport->setUsername($this->username)->setPassword($this->password);
     parent::init();
 }
开发者ID:sobit,项目名称:swiftmailer-component,代码行数:10,代码来源:SwiftMailerComponent.php


示例4: testReport

 public function testReport()
 {
     //  Arrange.
     $transport = new \Swift_SmtpTransport();
     $transport->setHost('mailtrap.io');
     $transport->setPort(2525);
     $transport->setUsername(getenv('MAILTRAP_USERNAME'));
     $transport->setPassword(getenv('MAILTRAP_PASSWORD'));
     $mailer = new Swift_Mailer($transport);
     $message = new Swift_Message();
     $message->addTo('[email protected]');
     $message->setFrom('[email protected]');
     $body = new Body(new VarCloner(), new CliDumper());
     $compiler = new Compiler(new CommonMarkConverter(), new CssToInlineStyles());
     $email = new Email($mailer, $message, $body, $compiler);
     $exception = new DomainException('Testing a domain exception');
     $extra = ['only' => 'testing12321'];
     // Act.
     $email->report($exception, $extra);
     // Assert.
     $message = $this->mailtrap->get('inboxes/' . getenv('MAILTRAP_INBOX') . '/messages')->json()[0];
     $this->assertSame('Exception: Testing a domain exception', $message['subject']);
     $this->assertContains('$email->report($exception, $extra);', $message['text_body']);
     $this->assertContains("exception 'DomainException' with message 'Testing a domain exception'", $message['text_body']);
     $this->assertContains('{main}', $message['text_body']);
     $this->assertContains('"only" => "testing12321"', $message['text_body']);
     $this->assertContains('_SERVER', $message['text_body']);
 }
开发者ID:morrislaptop,项目名称:error-tracker-adapter-email,代码行数:28,代码来源:EmailTest.php


示例5: init

 protected function init($config = array())
 {
     $transport = new \Swift_SmtpTransport($this->smtpHost, $this->smtpPort, $this->smtpSecure);
     $transport->setUsername($this->smtpUser);
     $transport->setPassword($this->smtpPassword);
     $this->mailer = new \Swift_Mailer($transport);
     return parent::init();
 }
开发者ID:mpf-soft,项目名称:app-basic,代码行数:8,代码来源:SwiftMailer.php


示例6: connect

 /**
  * Connect to Mail server
  *
  * @param array $config
  * @return boolean
  */
 public function connect(array $config)
 {
     // Create the Transport
     $this->mailer = new \Swift_SmtpTransport($config['server'], $config['port'], sizeof($config['secure']) > 0 ? $config['secure'] : null);
     $this->mailer->setUsername($config['username']);
     $this->mailer->setPassword($config['password']);
     $this->mailer->start();
     return $this->mailer->isStarted();
 }
开发者ID:stanislav-web,项目名称:express-mailer,代码行数:15,代码来源:LocalDomain.php


示例7: __construct

 /**
  * Mailer constructor.
  * @param $configuration
  */
 public function __construct($configuration)
 {
     $transport = new \Swift_SmtpTransport($configuration["host"], $configuration["port"]);
     $transport->setUsername($configuration["username"]);
     $transport->setPassword($configuration["password"]);
     $transport->setAuthMode($configuration["auth_mode"]);
     $transport->setEncryption($configuration["encryption"]);
     $this->mailer = new \Swift_Mailer($transport);
     $this->debugMail = isset($configuration["debug_email"]) ? $configuration["debug_email"] : null;
 }
开发者ID:nagyatka,项目名称:kodiapp,代码行数:14,代码来源:Mailer.php


示例8: send_breakin_alert

 function send_breakin_alert($email, $password)
 {
     $transporter = new Swift_SmtpTransport('smtp.gmail.com', 465, 'ssl');
     $transporter->setUsername('');
     $transporter->setPassword('');
     $message = new Swift_Message($transporter);
     $message->setTo(array($email => $email));
     $message->setSubject("Note to Myself - Break-in Attempt");
     $message->addPart("Your password has been reset after 3 failed log-in attempts.</br>Your new password is <strong>{$password}</strong>", 'text/html');
     $message->setFrom("", "");
     $mailer = new Swift_Mailer($transporter);
     $mailer->send($message);
 }
开发者ID:TrevorBroderick,项目名称:bcit-courses,代码行数:13,代码来源:Mailer.php


示例9: __getSwiftMailer

 /**
  * @param $from
  * @return \Swift_Mailer
  */
 protected function __getSwiftMailer($from)
 {
     if (!isset($this->swiftMailers[$hash = md5(json_encode($from))])) {
         $transport = new \Swift_SmtpTransport(isset($from['smtpHost']) ? $from['smtpHost'] : '127.0.0.1', isset($from['smtpPort']) ? $from['smtpPort'] : 25, isset($from['smtpSecure']) ? $from['smtpSecure'] : false);
         if (isset($from['smtpUser'])) {
             $transport->setUsername($from['smtpUser']);
         }
         if (isset($from['smtpPassword'])) {
             $transport->setPassword($from['smtpPassword']);
         }
         $this->swiftMailers[$hash] = new \Swift_Mailer($transport);
     }
     return $this->swiftMailers[$hash];
 }
开发者ID:mpf-soft,项目名称:mpf,代码行数:18,代码来源:MailHelper.php


示例10: createSmtpMailer

 /**
  * @param string|null $host
  * @param int|null    $port
  * @param array|null  $headers
  * @param string|null $username
  * @param string|null $password
  * @param string|null $security
  * @return CM_Mail_Mailer
  */
 public function createSmtpMailer($host = null, $port = null, array $headers = null, $username = null, $password = null, $security = null)
 {
     $host = null !== $host ? (string) $host : 'localhost';
     $port = null !== $port ? (int) $port : 25;
     $headers = null !== $headers ? (array) $headers : [];
     $security = null !== $security ? (string) $security : null;
     $transport = new Swift_SmtpTransport($host, $port, $security);
     if (null !== $username) {
         $transport->setUsername((string) $username);
     }
     if (null !== $password) {
         $transport->setPassword((string) $password);
     }
     return new CM_Mail_Mailer($transport, $headers);
 }
开发者ID:cargomedia,项目名称:cm,代码行数:24,代码来源:MailerFactory.php


示例11: __construct

 public function __construct()
 {
     // 设置邮件系统服务器、端口、加密方式以及用户账号信息
     $this->transport = \Swift_SmtpTransport::newInstance($this->host, $this->port, $this->encryption)->setUsername($this->username)->setPassword($this->password);
     // 传入上面配置好的参数用以得到一个Swift_Mailer实例化对象
     $this->mailer = \Swift_Mailer::newInstance($this->transport);
 }
开发者ID:tiandongxiao,项目名称:test,代码行数:7,代码来源:QQMailer.php


示例12: __construct

 function __construct()
 {
     // include swift mailer
     require ENGINE_PATH . 'swiftmailer/classes/Swift.php';
     Swift::init();
     Swift::registerAutoload();
     //Yii::import('system.vendors.swiftMailer.classes.Swift', true);
     //Yii::registerAutoloader(array('Swift','autoload'));
     require_once ENGINE_PATH . 'swiftmailer/swift_init.php';
     //Yii::import('system.vendors.swiftMailer.swift_init', true);
     switch ($this->params['transportType']) {
         case 'smtp':
             $transport = Swift_SmtpTransport::newInstance($this->params['smtpServer'], $this->params['smtpPort'], $this->params['smtpSequre'])->setUsername($this->params['smtpUsername'])->setPassword($this->params['smtpPassword']);
             break;
         case 'sendmail':
             $transport = Swift_SendmailTransport::newInstance($this->params['sendmailCommand']);
             break;
         default:
         case 'mail':
             $transport = Swift_MailTransport::newInstance();
             break;
     }
     $this->toEmail = 'noreplay@' . $_SERVER['HTTP_HOST'];
     $this->fromEmail = 'noreplay@' . $_SERVER['HTTP_HOST'];
     $this->path = "http://" . $_SERVER['HTTP_HOST'] . "/submit/mailtpl/";
     $this->mailer = Swift_Mailer::newInstance($transport);
     $this->mes = Swift_Message::newInstance();
 }
开发者ID:rjon76,项目名称:netspotapp,代码行数:28,代码来源:classEmailReporter.php


示例13: __invoke

 /**
  * Create an object
  *
  * @param  ContainerInterface $container
  * @param  string $requestedName
  * @param  null|array $options
  * @return object|\Swift_Mailer
  * @throws ServiceNotFoundException if unable to resolve the service.
  * @throws ServiceNotCreatedException if an exception is raised when
  *     creating a service.
  * @throws ContainerException if any other error occurs
  */
 public function __invoke(ContainerInterface $container, $requestedName, array $options = null) : \Swift_Mailer
 {
     $mailConfig = $container->get('config')['mail'];
     $smtp = $mailConfig['smtp'];
     $transport = \Swift_SmtpTransport::newInstance($smtp['server'], $smtp['port'], $smtp['ssl'])->setUsername($smtp['username'])->setPassword($smtp['password']);
     return new \Swift_Mailer($transport);
 }
开发者ID:acelaya,项目名称:alejandrocelaya.com,代码行数:19,代码来源:SwiftMailerFactory.php


示例14: respond

 public function respond(array $communication, \stdClass $msg)
 {
     $result = $this->generateResponse($communication);
     if (preg_match('/^\\s*re:/', $msg->subject)) {
         $subject = $msg->subject;
     } else {
         $subject = 'Re: ' . $msg->subject;
     }
     if (isset($this->config['name'])) {
         $from = array($this->config['email_address'] => $this->config['name']);
     } else {
         $from = array($this->config['email_address']);
     }
     $to = array($msg->from_email);
     if (isset($msg->headers->{'Message-Id'})) {
         $message_id = $msg->headers->{'Message-Id'};
     } else {
         $message_id = false;
     }
     // TODO - set reply to id
     $transport = \Swift_SmtpTransport::newInstance('smtp.mandrillapp.com', 587);
     $transport->setUsername($this->config['mandrill_username']);
     $transport->setPassword($this->config['mandrill_password']);
     $swift = \Swift_Mailer::newInstance($transport);
     $message = new \Swift_Message($subject);
     $message->setFrom($from);
     $message->setBody($result);
     $message->setTo($to);
     $result = $swift->send($message);
 }
开发者ID:sriramsv,项目名称:jarvis,代码行数:30,代码来源:MandrillBot.php


示例15: loadConfig

 /**
  * Parse the configuration file
  *
  * @param array $parsedConfig
  */
 private function loadConfig($parsedConfig)
 {
     if (isset($parsedConfig['moduleConf']['Type']) && $parsedConfig['moduleConf']['Type'] == "smtp") {
         $this->transport = \Swift_SmtpTransport::newInstance();
         if (isset($parsedConfig['moduleConf']['Host']) && $parsedConfig['moduleConf']['Host'] != "") {
             $this->transport->setHost($parsedConfig['moduleConf']['Host']);
         }
         if (isset($parsedConfig['moduleConf']['Port']) && $parsedConfig['moduleConf']['Port'] != "") {
             $this->transport->setPort($parsedConfig['moduleConf']['Port']);
         }
         if (isset($parsedConfig['moduleConf']['Username']) && $parsedConfig['moduleConf']['Username'] != "") {
             $this->transport->setUsername($parsedConfig['moduleConf']['Username']);
         }
         if (isset($parsedConfig['moduleConf']['Password']) && $parsedConfig['moduleConf']['Password'] != "") {
             $this->transport->setPassword($parsedConfig['moduleConf']['Password']);
         }
         if (isset($parsedConfig['moduleConf']['Encryption']) && $parsedConfig['moduleConf']['Encryption'] != "") {
             $this->transport->setEncryption($parsedConfig['moduleConf']['Encryption']);
         }
     } elseif (isset($parsedConfig['moduleConf']['Type']) && $parsedConfig['moduleConf']['Type'] == "sendmail") {
         $this->transport = \Swift_SendmailTransport::newInstance('/usr/sbin/sendmail -bs');
     } else {
         $this->transport = \Swift_MailTransport::newInstance();
     }
 }
开发者ID:stonedz,项目名称:pff2,代码行数:30,代码来源:Mail.php


示例16: __construct

 public function __construct($aConfigs = array())
 {
     $this->sName = "Mail";
     $this->sVersion = "1.0";
     $sFileName = $this->getBasePath() . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'swiftmailer' . DIRECTORY_SEPARATOR . 'lib' . DIRECTORY_SEPARATOR . 'swift_required.php';
     if (!file_exists($sFileName)) {
         return false;
     }
     require_once $sFileName;
     parent::__construct($aConfigs);
     $sMethod = isset($this->aConfigs['method']) ? $this->aConfigs['method'] : "mail";
     if ($sMethod == "smtp") {
         $sPort = isset($this->aConfigs['port']) ? $this->aConfigs['port'] : 25;
         $mSecure = isset($this->aConfigs['authenticate']) ? $this->aConfigs['authenticate'] : "tls";
         $sHost = isset($this->aConfigs['host']) ? $this->aConfigs['host'] : "localhost";
         $sUserName = isset($this->aConfigs['user']) ? $this->aConfigs['user'] : "";
         $sPassword = isset($this->aConfigs['password']) ? $this->aConfigs['password'] : "";
         $transport = \Swift_SmtpTransport::newInstance($sHost, $sPort, $mSecure);
         $transport->setUserName($sUserName);
         $transport->setPassword($sPassword);
     } else {
         $transport = \Swift_MailTransport::newInstance();
     }
     $this->oMailer = \Swift_Mailer::newInstance($transport);
 }
开发者ID:nghiacr002,项目名称:simplepush,代码行数:25,代码来源:Mail.php


示例17: send

 /**
  * Sends the digest
  */
 public function send()
 {
     $lastMonths = new \DateTime();
     $lastMonths->modify('-6 month');
     $parameters = array('modified_at >= ?0 AND digest = "Y" AND notifications <> "N"', 'bind' => array($lastMonths->getTimestamp()));
     $users = array();
     foreach (Users::find($parameters) as $user) {
         if ($user->email && strpos($user->email, '@') !== false && strpos($user->email, '@users.noreply.github.com') === false) {
             $users[trim($user->email)] = $user->name;
         }
     }
     $fromName = $this->config->mail->fromName;
     $fromEmail = $this->config->mail->fromEmail;
     $url = $this->config->site->url;
     $subject = 'Top Stories from Phosphorum ' . date('d/m/y');
     $lastWeek = new \DateTime();
     $lastWeek->modify('-1 week');
     $order = 'number_views + ' . '((IF(votes_up IS NOT NULL, votes_up, 0) - ' . 'IF(votes_down IS NOT NULL, votes_down, 0)) * 4) + ' . 'number_replies + IF(accepted_answer = "Y", 10, 0) DESC';
     $parameters = array('created_at >= ?0 AND deleted != 1 AND categories_id <> 4', 'bind' => array($lastWeek->getTimestamp()), 'order' => $order, 'limit' => 10);
     $e = $this->escaper;
     $content = '<html><head></head><body><p><h1 style="font-size:22px;color:#333;letter-spacing:-0.5px;line-height:1.25;font-weight:normal;padding:16px 0;border-bottom:1px solid #e2e2e2">Top Stories from Phosphorum</h1></p>';
     foreach (Posts::find($parameters) as $post) {
         $user = $post->user;
         if ($user == false) {
             continue;
         }
         $content .= '<p><a style="text-decoration:none;display:block;font-size:20px;color:#333;letter-spacing:-0.5px;line-height:1.25;font-weight:normal;color:#155fad" href="' . $url . '/discussion/' . $post->id . '/' . $post->slug . '">' . $e->escapeHtml($post->title) . '</a></p>';
         $content .= '<p><table width="100%"><td><table><tr><td>' . '<img src="https://secure.gravatar.com/avatar/' . $user->gravatar_id . '?s=32&amp;r=pg&amp;d=identicon" width="32" height="32" alt="' . $user->name . ' icon">' . '</td><td><a style="text-decoration:none;color:#155fad" href="' . $url . '/user/' . $user->id . '/' . $user->login . '">' . $user->name . '<br><span style="text-decoration:none;color:#999;text-decoration:none">' . $user->getHumanKarma() . '</span></a></td></tr></table></td><td align="right"><table style="border: 1px solid #dadada;" cellspacing=5>' . '<td align="center"><label style="color:#999;margin:0px;font-weight:normal;">Created</label><br>' . $post->getHumanCreatedAt() . '</td>' . '<td align="center"><label style="color:#999;margin:0px;font-weight:normal;">Replies</label><br>' . $post->number_replies . '</td>' . '<td align="center"><label style="color:#999;margin:0px;font-weight:normal;">Views</label><br>' . $post->number_views . '</td>' . '<td align="center"><label style="color:#999;margin:0px;font-weight:normal;">Votes</label><br>' . ($post->votes_up - $post->votes_down) . '</td>' . '</tr></table></td></tr></table></p>';
         $content .= $this->markdown->render($e->escapeHtml($post->content));
         $content .= '<p><a style="color:#155fad" href="' . $url . '/discussion/' . $post->id . '/' . $post->slug . '">Read more</a></p>';
         $content .= '<hr style="border: 1px solid #dadada">';
     }
     $textContent = strip_tags($content);
     $htmlContent = $content . '<p style="font-size:small;-webkit-text-size-adjust:none;color:#717171;">';
     $htmlContent .= PHP_EOL . 'This email was sent by Phalcon Framework. Change your e-mail preferences <a href="' . $url . '/settings">here</a></p>';
     foreach ($users as $email => $name) {
         try {
             $message = new \Swift_Message('[Phalcon Forum] ' . $subject);
             $message->setTo(array($email => $name));
             $message->setFrom(array($fromEmail => $fromName));
             $bodyMessage = new \Swift_MimePart($htmlContent, 'text/html');
             $bodyMessage->setCharset('UTF-8');
             $message->attach($bodyMessage);
             $bodyMessage = new \Swift_MimePart($textContent, 'text/plain');
             $bodyMessage->setCharset('UTF-8');
             $message->attach($bodyMessage);
             if (!$this->transport) {
                 $this->transport = \Swift_SmtpTransport::newInstance($this->config->smtp->host, $this->config->smtp->port, $this->config->smtp->security);
                 $this->transport->setUsername($this->config->smtp->username);
                 $this->transport->setPassword($this->config->smtp->password);
             }
             if (!$this->mailer) {
                 $this->mailer = \Swift_Mailer::newInstance($this->transport);
             }
             $this->mailer->send($message);
         } catch (\Exception $e) {
             echo $e->getMessage(), PHP_EOL;
         }
     }
 }
开发者ID:woyifang,项目名称:forum,代码行数:63,代码来源:Digest.php


示例18: __construct

    /**
     * Base constructor.
     * In the base constructor the bridge gets the mailer configuration.
     *
     * @param ConfigObject $config The base configuration.
     *
     * @throws SwiftMailerException
     */
    public function __construct($config)
    {
        $this->config = $config;
        $transportType = strtolower($config->get('Transport.Type', 'mail'));
        $disableDelivery = $config->get('DisableDelivery', false);
        if ($disableDelivery) {
            $transportType = 'null';
        }
        // create Transport instance
        switch ($transportType) {
            case 'smtp':
                $transport = \Swift_SmtpTransport::newInstance($config->get('Transport.Host', 'localhost'), $config->get('Transport.Port', 25), $config->get('Transport.AuthMode', null));
                $transport->setUsername($config->get('Transport.Username', ''));
                $transport->setPassword($config->get('Transport.Password', ''));
                $transport->setEncryption($config->get('Transport.Encryption', null));
                break;
            case 'mail':
                $transport = \Swift_MailTransport::newInstance();
                break;
            case 'sendmail':
                $transport = \Swift_SendmailTransport::newInstance($config->get('Transport.Command', '/usr/sbin/sendmail -bs'));
                break;
            case 'null':
                $transport = \Swift_NullTransport::newInstance();
                break;
            default:
                throw new SwiftMailerException('Invalid transport.type provided.
												Supported types are [smtp, mail, sendmail, null].');
                break;
        }
        // create Mailer instance
        $this->mailer = \Swift_Mailer::newInstance($transport);
        // register plugins
        $this->registerPlugins($config);
    }
开发者ID:Nkelliny,项目名称:Framework,代码行数:43,代码来源:Transport.php


示例19: EnviarCorreoConfirmacionTransaccion

 public function EnviarCorreoConfirmacionTransaccion($nombre, $email, $id_transaccion)
 {
     //echo "Enviando Correos";
     //ini_set('max_execution_time', 28800); //240 segundos = 4 minutos
     //Enviar correo electr�nico
     $url = base_url();
     $transport = Swift_SmtpTransport::newInstance()->setHost('smtp.gmail.com')->setPort(465)->setEncryption('ssl')->setUsername('[email protected]')->setPassword('passsword');
     //Create the Mailer using your created Transport
     $mailer = Swift_Mailer::newInstance($transport);
     //$this->load->model("Solicitud_model", "solicitud");
     //$query = $this->solicitud->getAlumnosCorreo();
     //Pass it as a parameter when you create the message
     $message = Swift_Message::newInstance();
     //Give the message a subject
     //Or set it after like this
     $message->setSubject('Confirmacion Transaccion Agencia');
     //[email protected]
     $message->setFrom(array('[email protected]' => 'Agencia'));
     $message->addTo($email);
     //$message->addTo('[email protected]');
     //$message->addBcc('[email protected]');
     //Add alternative parts with addPart()
     $failedRecipients = array();
     $message->addPart("<h2>Gracias por su preferencia, </h2>" . $nombre . "\n                <br>\n                <h3>Su transaccion ha sido realizada con éxito.</h3>\n                <br>\n                No. Transaccion: " . $id_transaccion . "<br>\n                ---<br>\n                ", 'text/html');
     if (!$mailer->send($message)) {
         return FALSE;
     }
     return TRUE;
 }
开发者ID:fabishodev,项目名称:agencia,代码行数:29,代码来源:Mensaje.php


示例20: sendAppointmentNotif

    public function sendAppointmentNotif($lead)
    {
    	$transport = Swift_SmtpTransport::newInstance('smtp.gmail.com', 465, 'ssl')
		->setUsername('[email protected]')
		->setPassword('rocketman88')
		;

		$mailer = Swift_Mailer::newInstance($transport);

		$body = "Howdy! \n\n" .
		"A new appointment request has been recorded. \n".
		"Below are the details: \n\n".
		"Preferred Date: ".$lead['date']."\n".
		"Preferred Time: ".$lead['time']."\n".
		"Name: ".$lead['fname']." ".$lead['lname']."\n".
		"Email: ".$lead['email']."\n".
		"Contact Number: ".$lead['contact']."\n".
		"Present Country: ".$lead['country']."\n".
		"Nationality: ".$lead['nationality']."\n".
		"Unit Interested in: ".$lead['unit']."\n".
		"Notes: ".$lead['notes']."\n\n".
		"This message was generated at DMCI Leasing Website.";

		$message = Swift_Message::newInstance('New Appointment Request Submitted in Leasing Website')
		->setFrom(array('[email protected]' => 'DMCI Leasing Webmaster'))
		->setTo(array('[email protected]' => 'DMCI Leasing Services'))
		->setBcc(array('[email protected]', '[email protected]', '[email protected]'))
		->setBody($body)
		;

		$result = $mailer->send($message);

		return $result;
    }
开发者ID:somidex,项目名称:leasing2016,代码行数:34,代码来源:MailerHandler.php



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


鲜花

握手

雷人

路过

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

请发表评论

全部评论

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