亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

用Gmail SMTP發送電子郵件和代碼點火器電子郵件庫

用Gmail SMTP發送電子郵件和代碼點火器電子郵件庫

PHP
慕標琳琳 2019-06-28 10:32:08
用Gmail SMTP發送電子郵件和代碼點火器電子郵件庫<?phpclass Email extends Controller {     function Email()     {         parent::Controller();            $this->load->library('email');     }     function index()     {         $config['protocol']    = 'smtp';         $config['smtp_host']    = 'ssl://smtp.gmail.com';         $config['smtp_port']    = '465';         $config['smtp_timeout'] = '7';         $config['smtp_user']    = '[email protected]';         $config['smtp_pass']    = '*******';         $config['charset']    = 'utf-8';         $config['newline']    = "\r\n";         $config['mailtype'] = 'text'; // or html         $config['validation'] = TRUE; // bool whether to validate email or not               $this->email->initialize($config);         $this->email->from('[email protected]', 'myname');         $this->email->to('[email protected]');          $this->email->subject('Email Test');         $this->email->message('Testing the email class.');           $this->email->send();         echo $this->email->print_debugger();         $this->load->view('email_view');     }}我得到了這個錯誤:A PHP Error was encounteredSeverity: WarningMessage: fsockopen() [function.fsockopen]: unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)Filename: libraries/Email.phpLine Number: 1641使用PORT 25/587我發現了一個錯誤:A PHP Error was encounteredSeverity: WarningMessage: fsockopen() [function.fsockopen]: SSL operation failed with code 1. OpenSSL Error messages: error:140770FC:SSL routines:func(119):reason(252)Filename: libraries/Email.phpLine Number: 1641我現在不想用phpmailer了。(實際上我曾嘗試使用phpmailer,但失敗了)?;镉媯?,我該怎么解決這個問題?
查看完整描述

3 回答

?
胡子哥哥

TA貢獻1825條經驗 獲得超6個贊

您需要在PHP配置中啟用SSL。負載php.ini并找到以下一行:

;extension=php_openssl.dll

取消評論。d:

(從語句中移除分號)

extension=php_openssl.dll


查看完整回答
反對 回復 2019-06-28
  • 3 回答
  • 0 關注
  • 2172 瀏覽

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號