我想知道在我寫一個問題之前,我是否可以通過cmd行發送郵件。所以我跟着these steps發了一封cmd給我的電子郵件給我和我的同事,他們正在研究我的應用程序。來自cmd行的消息採用了它應該發佈的格式。CakePHP:通過SMTP發送郵件到MS OUTLOOK - > SMTP錯誤:504 5.7.4無法識別的身份驗證類型
(內部應用程序,應該發送郵件只是我的同事Outlook帳戶)
似乎一切都連接罰款,所以我想我在CakePHP的代碼有一個錯誤:
一切都在郵件代碼我到目前爲止是這樣的:
應用程序/配置/ email.php
public $smtp = array(
'transport' => 'Smtp',
'from' => array('[email protected]'),
'host' => 'ip_address_of_my_host',
'port' => 25,
'timeout' => 30,
'username' => '[email protected]',
'password' => 'password',
'client' => null,
'log' => true,
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
);
UsersController.php(測試發送郵件功能)
public function test_send_email() {
$this->autoRender = false;
App::uses('CakeEmail', 'Network/Email');
$email = new CakeEmail('smtp');
$email->from(array('[email protected]' => 'APP TEST'));
$email->to('[email protected]');
$email->subject('Subject of testing');
$email->send('Message of testing');
}
負載達5秒鐘後我得到:SMTP錯誤:504 5.7.4無法識別身份驗證類型