Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/codeigniter/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用codeigniter发送电子邮件时主题长度问题_Php_Codeigniter - Fatal编程技术网

Php 使用codeigniter发送电子邮件时主题长度问题

Php 使用codeigniter发送电子邮件时主题长度问题,php,codeigniter,Php,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设置为 $co

当邮件主题太长时,会出现以下错误

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个字符的电子邮件主题引起:

更改电子邮件配置可能会有帮助。有两种方法:

  • 使用单独的配置参数创建电子邮件对象的单独实例:
    $email=new CI\u email(数组('newline'=>“\r\n”)
  • 使用内嵌配置字符串:
    $this->email->newline=“\r\n”
    $this->email->crlf=“\n”

  • 你用谷歌搜索错误信息了吗?”您的服务器可能未配置为使用此方法发送邮件。'不知道CodeIgniter,但。。。我们说的是什么尺寸?200字符?2,000? 20000000?我想您的crlf也应该是\r\n。