<em id="hh9r9"><nobr id="hh9r9"><nobr id="hh9r9"></nobr></nobr></em>

        <form id="hh9r9"><listing id="hh9r9"><meter id="hh9r9"></meter></listing></form>

                        <address id="hh9r9"></address>

                        葵花寶典教程,一個自學編程平臺

                        葵花寶典教程,一個自學編程平臺

                        Python 爬蟲利器三之 Xpath 語法與用法

                        安裝

                        1
                        pip install lxml

                        初步使用

                        首先我們利用它來解析 HTML 代碼,先來一個小例子來感受一下它的基本用法。

                        1
                        2
                        3
                        4
                        5
                        6
                        7
                        8
                        9
                        10
                        11
                        12
                        13
                        14
                        15
                        from lxml import etree
                        text = '''
                        <div>
                           <ul>
                                <li class="item-0"><a href="link1.html">first item</a></li>
                                <li class="item-1"><a href="link2.html">second item</a></li>
                                <li class="item-inactive"><a href="link3.html">third item</a></li>
                                <li class="item-1"><a href="link4.html">fourth item</a></li>
                                <li class="item-0"><a href="link5.html">fifth item</a>
                            </ul>
                        </div>
                        '''
                        html = etree.HTML(text)
                        result = etree.tostring(html)
                        print(result)

                        首先我們使用 lxml 的 etree 庫,然后利用 etree.HTML 初始化,然后我們將其打印出來。 其中,這里體現了 lxml 的一個非常實用的功能就是自動修正 html 代碼,大家應該注意到了,最后一個 li 標簽,其實我把尾標簽刪掉了,是不閉合的。不過,lxml 因為繼承了 libxml2 的特性,具有自動修正 HTML 代碼的功能。 所以輸出結果是這樣的

                        1
                        2
                        3
                        4
                        5
                        6
                        7
                        8
                        9
                        10
                        11
                        12
                        <html><body>
                        <div>
                           <ul>
                                <li class="item-0"><a href="link1.html">first item</a></li>
                                <li class="item-1"><a href="link2.html">second item</a></li>
                                <li class="item-inactive"><a href="link3.html">third item</a></li>
                                <li class="item-1"><a href="link4.html">fourth item</a></li>
                                <li class="item-0"><a href="link5.html">fifth item</a></li>
                        </ul>
                        </div>

                        </body></html>

                        不僅補全了 li 標簽,還添加了 body,html 標簽。

                        文件讀取

                        除了直接讀取字符串,還支持從文件讀取內容。比如我們新建一個文件叫做 hello.html,內容為

                        1
                        2
                        3
                        4
                        5
                        6
                        7
                        8
                        9
                        <div>
                           <ul>
                                <li class="item-0"><a href="link1.html">first item</a></li>
                                <li class="item-1"><a href="link2.html">second item</a></li>
                                <li class="item-inactive"><a href="link3.html"><span class="bold">third item</span></a></li>
                                <li class="item-1"><a href="link4.html">fourth item</a></li>
                                <li class="item-0"><a href="link5.html">fifth item</a></li>
                            </ul>
                        </div>

                        利用 parse 方法來讀取文件。

                        1
                        2
                        3
                        4
                        from lxml import etree
                        html = etree.parse('hello.html')
                        result = etree.tostring(html, pretty_print=True)
                        print(result)

                        同樣可以得到相同的結果。

                        XPath 實例測試

                        依然以上一段程序為例 (1)獲取所有的

                        =

                        [ 取li text

                        result = html.xpath('/html/body/div[1]/div/div[1]/ul[1]/li[3]')

                        print (result[0].xpath('string(.)').strip())

                        ]

                        =

                        [取a text

                        result = html.xpath('/html/body/div[1]/div/div[1]/ul[1]/li[3]/a/text()')

                        print (result)

                        ]

                        =

                        [取a  href

                        result = html.xpath('/html/body/div[1]/div/div[1]/ul[1]/li[3]/a/@href')

                        result = html.xpath('/html/body/div[1]/div/div[1]/ul[1]/li[3]/a/@href')


                        print (result)

                        ]

                        文件自動加https

                        <meta http-equiv="Content-Security-Policy" content="upgrade-insecure-requests">

                        <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">

                        <meta name="viewport" content="width=device-width,initial-scale=1.0">

                        <meta http-equiv="Cache-control" content="public">

                        <meta property="og:site_name" content="Trioangle" />

                        <meta property="og:image" content="/images/logo.svg" />

                        <meta property="og:image:secure_url" content="/images/logo.svg" />

                        <meta property="og:locale" content="en_US" />

                        <meta property="og:type" content="article" />


                        PHP laravel框架實現SMTP發送郵箱

                         首先在.env配置里配置信息

                         

                        MAIL_DRIVER=smtp//主機

                        MAIL_HOST=smtp.163.com//主機網址

                        MAIL_PORT=465//端口號

                        MAIL_USERNAME=用戶名

                        MAIL_PASSWORD=授權碼(不是密碼)

                        MAIL_ENCRYPTION=ssl//安全碼


                         在控制器里引入

                        use Illuminate\Support\Facades\Mail;
                        再寫一個方法,直接走一個方法里的程序就ok
                        class WyController extends BaseController
                        {
                            public function r(){
                                Mail::raw("范志超超超超超",function ($mesage){
                                    $mesage->from("17601079705@163.com","范志超");
                                    $mesage->subject("一二三四");
                                    $mesage->to("904712081@qq.com");
                                });
                            }
                        }

                        or

                        public function send()

                            {

                                $name = '學院君';

                                $flag = Mail::send('emails.test',['name'=>$name],function($message){

                                    $to = '1072155122@qq.com';

                                    $message ->to($to)->subject('測試郵件');

                                });

                                if($flag){

                                    echo '發送郵件成功,請查收!';

                                }else{

                                    echo '發送郵件失敗,請重試!';

                                }

                            }


                        html中如何使一個table或者div永遠處于中間位置

                        tml中使一個table或者div永遠處于中間位置,首先需要理解塊元素的概念,如div、table都是width和height屬性,然后在通過css中的一個margin屬性,來實現居中,具體用法看下圖:

                        不管瀏覽器的寬度是多少,這個屬性就會將div居中,具體看下代碼:

                        <html>

                        <head>

                        <style>

                        #round{

                        width:400px;                              //通過給divwidth和heigh值,在通過margin屬性來定位

                        height:200px;

                        margin:0 auto;

                        }


                        table{                                         //通過給divwidth和heigh值,在通過margin屬性來定位

                        width:300px;

                        height:50px;

                        margin:0 auto;

                        }


                        </style>

                        </head>

                        <body>

                        <div id="round">

                        <p>我會居中</p>

                        </div>


                        <table>

                        <tr>

                        <td>我會居中</td>

                        </tr>

                        </table>

                        </body>

                        </html>


                        div中內容上下居中小結

                        雖然div中內容上下居中的問題已經是一個比較古老的話題,但是最近發現還是有很多前端開發者在詢問如何實現。其實網絡上已經有很多資料和案例了,我這里再總結一下幾個比較常見的處理方式。

                        情形一:div限高,內容長度限一行

                        <style>
                        .v-align {
                        margin: 0 auto;
                        width: 200px;
                        height: 80px;
                        text-align: center;
                        line-height: 80px;
                        border: 1px solid #ddd;
                        }
                        </style>
                        <!-- html -->
                        <div class="v-align">我的內容只能有一行。</div>


                        情形二:div限高,內容不限

                        .v-mult {
                        margin: 0 auto;
                        width: 200px;
                        height: 100px;
                        border: 1px solid #ddd;
                        overflow: hidden;
                        }
                        .v-mult .empty,
                        .v-mult .text {
                        display: inline-block;
                        *display: inline;
                        *zoom: 1;
                        vertical-align: middle;
                        }
                        .v-mult .empty {
                        height: 100%;
                        }
                        <!-- html -->
                        <div class="v-mult">
                        <span class="empty"></span>
                        <span class="text">我的內容不限,多高都行
                        換行照常</span>
                        </div>


                        情形三:div高度不定,內容高度一定

                        .v-auto {
                        position: relative;
                        margin: 0 auto;
                        width: 200px;
                        border: 1px solid #ddd;
                        }
                        .v-auto .text {
                        position: absolute;
                        top: 50%;
                        margin-top: -50px;
                        height: 100px;
                        border: 1px dashed #ddd;
                        }
                        <!-- html -->
                        <div class="v-auto">
                        <div class="text">
                        我的高度是固定的,只有100px高,但是我的父及高度不定,我怎么垂直居中呢?
                        </div>
                        
                        
                        
                        
                        
                        </div>


                        情形四:div高度不定,內容高度不定

                        .v-auto-out {
                        position: relative;
                        margin: 0 auto;
                        width: 200px;
                        border: 1px solid #ddd;
                        }
                        .v-auto-out .auto-in {
                        position: absolute;
                        top: 50%;
                        border: 1px dashed #ddd;
                        /* 這里有兼容性問題 */
                        -webkit-transform: translateY(-50%);
                        -ms-transform: translateY(-50%);
                        -o-transform: translateY(-50%);
                        transform: translateY(-50%);
                        }
                        <!-- html -->
                        <div class="v-auto-out">
                        <div class="auto-in">我的高度不定,我的父及高度也不定,這下要上下居中,該如何是好?我們一起來瞧瞧吧。</div>
                        
                        
                        
                        
                        
                        </div>


                        DigitalOcean忘記root密碼怎么辦?

                        DigitalOcean忘記root密碼怎么辦?在這個時候我們可以選擇重置.

                        方法1


                        Access->

                        Reset root password

                        Clicking Reset Root Password below will immediately shut down your Droplet and set a new root password.

                        The new root password will be emailed to you within a few minutes. If the email doesn't arrive or the new password doesn't work, try using the recovery environment.

                        Do you wish to proceed?

                        方法2

                        Access->

                        Recovery Console

                        Use the Recovery Console if you need to use the recovery ISO or you can't connect to your Droplet with the Droplet Console. To use the recovery console, you must enable password authentication. If necessary, you can reset your root password below.


                        Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to conn

                        ====

                        [2022-03-16 02:32:13] local.ERROR: Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) {"exception":"[object] (Swift_TransportException(code: 0): Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) at /www/wwwroot/card.inkstarbox.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:261)

                        [stacktrace]

                        #0 [internal function]: Swift_Transport_StreamBuffer->{closure}(2, 'stream_socket_c...', '/www/wwwroot/ca...', 264, Array)

                        #1 /www/wwwroot/card.inkstarbox.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(264): stream_socket_client('ssl://smtp.gmai...', 110, 'Connection time...', 30, 4, Resource id #679)

                        #2 /www/wwwroot/card.inkstarbox.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(58): Swift_Transport_StreamBuffer->establishSocketConnection()

                        #3 /www/wwwroot/card.inkstarbox.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(143): Swift_Transport_StreamBuffer->initialize(Array)

                        #4 /www/wwwroot/card.inkstarbox.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(65): Swift_Transport_AbstractSmtpTransport->start()

                        #5 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(521): Swift_Mailer->send(Object(Swift_Message), Array)

                        #6 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(288): Illuminate\\Mail\\Mailer->sendSwiftMessage(Object(Swift_Message))

                        #7 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(484): Illuminate\\Mail\\Mailer->send('emails.test', Array, Object(Closure))

                        #8 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\\Mail\\MailManager->__call('send', Array)

                        #9 /www/wwwroot/card.inkstarbox.com/app/Http/Controllers/DoController.php(159): Illuminate\\Support\\Facades\\Facade::__callStatic('send', Array)

                        #10 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\DoController->personal_info(Object(Illuminate\\Http\\Request))

                        #11 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('personal_info', Array)

                        #12 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\DoController), 'personal_info')

                        #13 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()

                        #14 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\\Routing\\Route->run()

                        #15 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))

                        #16 /www/wwwroot/card.inkstarbox.com/app/Http/Middleware/SetLangMiddleware.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #17 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\SetLangMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #18 /www/wwwroot/card.inkstarbox.com/vendor/laravel/jetstream/src/Http/Middleware/ShareInertiaData.php(61): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #19 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Jetstream\\Http\\Middleware\\ShareInertiaData->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #20 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #21 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #22 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #23 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #24 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #25 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #26 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #27 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))

                        #28 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #29 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #30 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #31 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #32 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #33 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #34 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))

                        #35 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(670): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))

                        #36 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))

                        #37 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))

                        #38 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))

                        #39 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))

                        #40 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #41 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #42 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #43 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #44 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #45 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #46 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #47 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #48 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #49 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))

                        #50 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))

                        #51 /www/wwwroot/card.inkstarbox.com/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))

                        #52 {main}

                        "} 

                        [2022-03-16 02:32:56] local.ERROR: Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) {"exception":"[object] (Swift_TransportException(code: 0): Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out) at /www/wwwroot/card.inkstarbox.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:261)

                        [stacktrace]

                        #0 [internal function]: Swift_Transport_StreamBuffer->{closure}(2, 'stream_socket_c...', '/www/wwwroot/ca...', 264, Array)

                        #1 /www/wwwroot/card.inkstarbox.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(264): stream_socket_client('ssl://smtp.gmai...', 110, 'Connection time...', 30, 4, Resource id #679)

                        #2 /www/wwwroot/card.inkstarbox.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php(58): Swift_Transport_StreamBuffer->establishSocketConnection()

                        #3 /www/wwwroot/card.inkstarbox.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php(143): Swift_Transport_StreamBuffer->initialize(Array)

                        #4 /www/wwwroot/card.inkstarbox.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Mailer.php(65): Swift_Transport_AbstractSmtpTransport->start()

                        #5 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(521): Swift_Mailer->send(Object(Swift_Message), Array)

                        #6 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Mail/Mailer.php(288): Illuminate\\Mail\\Mailer->sendSwiftMessage(Object(Swift_Message))

                        #7 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Mail/MailManager.php(484): Illuminate\\Mail\\Mailer->send('emails.test', Array, Object(Closure))

                        #8 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\\Mail\\MailManager->__call('send', Array)

                        #9 /www/wwwroot/card.inkstarbox.com/app/Http/Controllers/DoController.php(159): Illuminate\\Support\\Facades\\Facade::__callStatic('send', Array)

                        #10 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\\Http\\Controllers\\DoController->personal_info(Object(Illuminate\\Http\\Request))

                        #11 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\\Routing\\Controller->callAction('personal_info', Array)

                        #12 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php(254): Illuminate\\Routing\\ControllerDispatcher->dispatch(Object(Illuminate\\Routing\\Route), Object(App\\Http\\Controllers\\DoController), 'personal_info')

                        #13 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Route.php(197): Illuminate\\Routing\\Route->runController()

                        #14 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(693): Illuminate\\Routing\\Route->run()

                        #15 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Routing\\Router->Illuminate\\Routing\\{closure}(Object(Illuminate\\Http\\Request))

                        #16 /www/wwwroot/card.inkstarbox.com/app/Http/Middleware/SetLangMiddleware.php(30): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #17 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\\Http\\Middleware\\SetLangMiddleware->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #18 /www/wwwroot/card.inkstarbox.com/vendor/laravel/jetstream/src/Http/Middleware/ShareInertiaData.php(61): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #19 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Laravel\\Jetstream\\Http\\Middleware\\ShareInertiaData->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #20 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #21 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Routing\\Middleware\\SubstituteBindings->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #22 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/VerifyCsrfToken.php(78): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #23 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\VerifyCsrfToken->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #24 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/View/Middleware/ShareErrorsFromSession.php(49): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #25 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\View\\Middleware\\ShareErrorsFromSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #26 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(121): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #27 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Session/Middleware/StartSession.php(63): Illuminate\\Session\\Middleware\\StartSession->handleStatefulRequest(Object(Illuminate\\Http\\Request), Object(Illuminate\\Session\\Store), Object(Closure))

                        #28 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Session\\Middleware\\StartSession->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #29 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/AddQueuedCookiesToResponse.php(37): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #30 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\AddQueuedCookiesToResponse->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #31 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Cookie/Middleware/EncryptCookies.php(67): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #32 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Cookie\\Middleware\\EncryptCookies->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #33 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #34 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))

                        #35 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(670): Illuminate\\Routing\\Router->runRouteWithinStack(Object(Illuminate\\Routing\\Route), Object(Illuminate\\Http\\Request))

                        #36 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\\Routing\\Router->runRoute(Object(Illuminate\\Http\\Request), Object(Illuminate\\Routing\\Route))

                        #37 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\\Routing\\Router->dispatchToRoute(Object(Illuminate\\Http\\Request))

                        #38 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\\Routing\\Router->dispatch(Object(Illuminate\\Http\\Request))

                        #39 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\\Foundation\\Http\\Kernel->Illuminate\\Foundation\\Http\\{closure}(Object(Illuminate\\Http\\Request))

                        #40 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #41 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #42 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #43 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\TransformsRequest->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #44 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #45 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\ValidatePostSize->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #46 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #47 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\\Foundation\\Http\\Middleware\\PreventRequestsDuringMaintenance->handle(Object(Illuminate\\Http\\Request), Object(Closure))

                        #48 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\\Pipeline\\Pipeline->Illuminate\\Pipeline\\{closure}(Object(Illuminate\\Http\\Request))

                        #49 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\\Pipeline\\Pipeline->then(Object(Closure))

                        #50 /www/wwwroot/card.inkstarbox.com/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\\Foundation\\Http\\Kernel->sendRequestThroughRouter(Object(Illuminate\\Http\\Request))

                        #51 /www/wwwroot/card.inkstarbox.com/public/index.php(52): Illuminate\\Foundation\\Http\\Kernel->handle(Object(Illuminate\\Http\\Request))

                        #52 {main}

                        "} 



                        ====

                        我的解決方案原來是 SELinux 導致了這個問題。這適用于 RedHat/CentOS 6。

                        允許 HTTPD(即 PHP)建立網絡套接字連接

                        setsebool -P httpd_can_network_connect on

                        允許 HTTPD(即 PHP)發送郵件。

                        setsebool -P httpd_can_sendmail on

                        ==

                        關于安全增強 Linux 的 RedHat 頁面

                        使用 Swift Mailer、GMail 和 PHP 發送電子郵件,權限被拒絕錯誤

                        有關如何為本地系統啟用 sendmail(和郵件)的說明。

                        ==

                        php laveral 發郵件

                        1 config 

                        #####google郵箱設置

                        MAIL_DRIVER=smtp

                        MAIL_HOST=smtp.gmail.com

                        MAIL_PORT=465

                        MAIL_USERNAME=imi@jennal.cn

                        MAIL_PASSWORD=bdczr

                        MAIL_ENCRYPTION=ssl

                        #####

                        #####163郵箱設置

                        MAIL_DRIVER=smtp

                        MAIL_HOST=smtp.163.com

                        MAIL_PORT=465

                        MAIL_USERNAME=ajennal.cn

                        MAIL_PASSWORD=MVjennal.cn

                        MAIL_ENCRYPTION=ssl

                        #####

                        2添加php 引用

                        use Mail;  or

                        use Illuminate\Support\Facades\Mail;

                        3發郵件部分添加如下代碼

                        $flag = Mail::send('emails.test',['data'=>$data2],function($message){      $to = 'imi@jennal.cn';      $message ->to($to)->subject('注冊郵件'); }); 

                        如果要傳數量

                        $flag = Mail::send('emails.test',['data'=>$data2],function($message) use ($data2){                   print_r($data2);                    $message ->to($data2['email'])->subject('注冊郵件');                   });

                        exit;

                        關鍵是use的區別

                        https://laravel.com/docs/5.1/mail

                        ==

                        js如何將按鈕設為禁用

                        js如何將按鈕設為禁用,有以下三種設置標用的方式


                        方式1

                        //如何禁用按鈕


                        form1.btnUpload.disabled = "disabled";


                        方式2

                        //將按鈕設為禁用


                        document.getElementById("Submit").setAttribute("disabled",true);

                        方式3

                        //將按鈕設為禁用


                        document.getElementById("Submit").disabled=true;



                        Google 企業郵箱設置教程POP3和SMTP方法

                        進入Google 企業郵箱開啟 pop功能 保存成功后到其他郵箱設置

                        關鍵點要啟用SSL和端口號的設置


                        POP3: pop.gmail.com
                        端口: 995


                        啟用SSL安全鏈接


                        SMTP: smtp.gmail.com
                        端口: 465


                        啟用SSL安全鏈接

                        [

                        How to Use the Gmail SMTP Server to Send Emails for Free

                        ]

                        https://kinsta.com/blog/gmail-smtp-server/ 

                        << < 1 2 3 4 5 6 7 8 9 10 > >>

                        Copyright www.6798111.com Rights Reserved葵花寶典教程.鄂icp2022001145號-1

                        分享:

                        支付寶

                        微信

                        性欧美乱子伦,两根一进一出啊灌满了啊,被公侵犯玩弄漂亮人妻中文
                        <em id="hh9r9"><nobr id="hh9r9"><nobr id="hh9r9"></nobr></nobr></em>

                              <form id="hh9r9"><listing id="hh9r9"><meter id="hh9r9"></meter></listing></form>

                                              <address id="hh9r9"></address>