"504 Gateway Time-out"when sending mail by SMTP in CodeIgniter
4712 단어 PHPCodeIgniter
What happened?
The source code:
$config['protocol'] = 'smtp';
$config['smtp_host'] = $this->config['smtp_host'];
$config['smtp_user'] = $this->config['smtp_user'];
$config['smtp_pass'] = $this->config['smtp_pass'];
$config['smtp_port'] = $this->config['smtp_port'];
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$this->_CI->email->initialize($config);
$this->_CI->email->from($from_email, $from_name);
$this->_CI->email->to($to);
$this->_CI->email->subject($subject);
$this->_CI->email->message($body);
return $this->_CI->email->send();
Same source code, different SMTP server and user/password, some server/user run out with the "504 Gateway Time-out"error:It seems the action is depending on the SMTP servers.
How to fix this error?
Add these two lines in your code:
$config['newline'] = "\r\n";
$config['crlf'] = "\r\n";
This will make it working.reference:
Reference
이 문제에 관하여("504 Gateway Time-out"when sending mail by SMTP in CodeIgniter), 우리는 이곳에서 더 많은 자료를 발견하고 링크를 클릭하여 보았다 https://qiita.com/liubin/items/237dcba4d0259bf6b1d7텍스트를 자유롭게 공유하거나 복사할 수 있습니다.하지만 이 문서의 URL은 참조 URL로 남겨 두십시오.
우수한 개발자 콘텐츠 발견에 전념 (Collection and Share based on the CC Protocol.)