簡體   English   中英

使用Codeigniter發送電子郵件時出現主題長度問題

[英]subject length issue while sending email using codeigniter

當電子郵件主題太長時,出現以下錯誤

The following SMTP error was encountered:


451 See
http://pobox.com/~djb/docs/smtplf.html. Unable to send email using
PHP SMTP.  Your server might not be configured to send mail using
this method.

當縮短主題長度時,它可以正常工作。我的smtp config設置是

$config['protocol'] = 'smtp'; $config['smtp_host'] = 'host';
$config['smtp_port'] = '**'; $config['smtp_user'] = $email_id;
$config['smtp_pass'] = $password; $config['charset'] = 'utf-8';
$config['newline'] = "\r\n"; $config['crlf']    = "\n"; 
$config['wordwrap'] = TRUE; $config['wrapchars'] = 10;
$config['mailtype'] = "html";

提前致謝。

顯然,這是一個已知問題,是由電子郵件主題引起的,該主題超過75個字符: http : //codeigniter.com/forums/viewthread/154493/P15/#925385

更改電子郵件配置可能會有所幫助。 有兩種解決方法:

  1. 使用自己的單獨配置參數創建電子郵件對象的單獨實例: $email = new CI_Email(array('newline' => "\\r\\n"));
  2. 使用內聯配置字符串: $this->email->newline = "\\r\\n"; $this->email->crlf = "\\n";

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM