編輯: 我試圖使用codeigniter的庫發送電子郵件。每當我叫$這個 - >的電子郵件 - >發送()函數返回在Codeigniter電子郵件庫中調用發送方法時出錯
Warning: include(C:\xampp\htdocs\psems\application\views\errors\html\error_php.php): failed to open stream: No such file or directory in C:\xampp\htdocs\psems\system\core\Exceptions.php on line 269
Warning: include(): Failed opening 'C:\xampp\htdocs\psems\application\views\errors\html\error_php.php' for inclusion (include_path='.;C:\xampp\php\PEAR') in C:\xampp\htdocs\psems\system\core\Exceptions.php on line 269
這是我到目前爲止的代碼
$config = array();
$config['useragent'] = "CodeIgniter";
$config['mailpath'] = "/usr/bin/sendmail"; // or "/usr/sbin/sendmail"
$config['protocol'] = "smtp";
$config['smtp_host'] = "localhost";
$config['smtp_port'] = "25";
$config['mailtype'] = 'html';
$config['charset'] = 'utf-8';
$config['newline'] = "\r\n";
$config['wordwrap'] = TRUE;
$this->load->library('email');
$this->email->initialize($config);
$this->email->from('[email protected]', 'harold decapia');
$this->email->to('[email protected]');
$this->email->subject('Тест Email');
$this->email->message('Hello World');
$this->email->send(); //I tried commenting this out and there was no error returned
我很困惑,爲什麼它返回一個錯誤只需調用send方法。我必須先配置一些東西嗎?我想我在這裏失蹤的信息:(
而且一點點,有什麼辦法讓我知道了什麼錯誤它專門返回?據預先感謝您
嘗試回聲$這個 - >的電子郵件 - > print_debugger(); –
嘗試過,並且它說:「遇到以下SMTP錯誤:10061由於目標計算機主動拒絕,無法建立連接。 無法使用PHP SMTP發送電子郵件。您的服務器可能未配置爲使用此方法發送郵件。 「 –
你有沒有嘗試PHP郵件程序庫的smtp –