在php中发送邮箱验证时报错

 if ($res) {
//        发送邮件,以QQ邮箱为例
//        配置邮件服务器,得到传输对象
       $transport = Swift_SmtpTransport::newInstance("smtp.qq.com", 465);//25默认
       //设置登录账号和密码
       $transport->setUsername("2130337183@qq.com");
       $transport->setPassword($emailPassword);
//        得到发送邮件对象Swift_Mailer对象
       $mailer = Swift_Mailer::newInstance($transport);
//        得到邮件信息对象
       $message = Swift_Message::newInstance();
//        设置管理员的信息
       $message->setFrom(array("2130337183@qq.com" => "hello"));
//        将邮件发给谁
       $message->setTo(array($email => "imooc"));
//        设置邮件主题
       $message->setSubject("激活邮件");
       $url = "http://" . $_SERVER['HTTP_HOST'] . $_SERVER['PHP_SELF'] . "?act=active&token={$token}";
       $urlencode = urlencode($url);
       $str = <<<EOF
               亲爱的{$username}您好~!感谢您的注册我们网站<br>
               请点击此链接激活账号即可登录!<br/>
               <a href='{$url}'>{$urlencode}</a>
               <br/>
               如果点此链接无反应,可以将其复制到浏览器中来执行,链接的有效时间为24小时。
EOF;
       $message->setBody("{$str}", "text/html", 'utf-8');


报错信息

Fatal error: Maximum execution time of 30 seconds exceeded in E:\demo\loginAndResig\swiftmailer-master\lib\classes\Swift\Transport\StreamBuffer.php on line 165

php小白兔秀秀
浏览 1426回答 1
1回答
打开App,查看更多内容
随时随地看视频慕课网APP