yangball 发表于 2010-1-13 11:01:45

用CI发送邮件不成功

我用CI发送邮件
但不成功

$this->load->library('email');
      $config['protocol'] = 'smtp';
      $config['smtp_host']='XXXXXXXXX';                     
      $config['smtp_user']='XXXXXXXXXXXXXXXXXX';
      $config['smtp_pass']='XXXXXXXXXXXXXXXXX';
      $config['smtp_port']='XXXXXXXXXX';
      $config['smtp_timeout']='10';
      $config['validate']='true';
$this->email->initialize($config);
      $this->email->from('XXXXXXXXXX', 'XXXXXXXX');
$this->email->to('XXXXXXXXX');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');
if($this->email->send())
      echo 'ok';
else
    echo 'no';
echo "<hr>".$this->email->print_debugger();


但不成功,打印信息:
no
220 localhost.localdomain - Welcome to Qmail igenus Ver. 5 SMTP Server ESMTP
hello: 250-localhost.localdomain - Welcome to Qmail igenus Ver. 5 SMTP Server250-STARTTLS250-PIPELINING250-8BITMIME250-SIZE 20971520250 AUTH LOGIN PLAIN CRAM-MD5from: 250 okto: 250 okdata: 354 go ahead
451 See http://pobox.com/~djb/docs/smtplf.html.
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.
User-Agent: CodeIgniterDate: Wed, 13 Jan 2010 02:46:17 +0000From: "7 days Printing Solution" Return-Path: To: XXXXXX@126.comSubject: =?utf-8?Q?Email_Test?=Reply-To: "XXXXXXXXXXXXX.com" X-Sender: XXXXXXXXXXXXXXX.comX-Mailer: CodeIgniterX-Priority: 3 (Normal)Message-ID: <4b4d33f9e9311@XXX.com>Mime-Version: 1.0Content-Type: text/plain; charset=utf-8Content-Transfer-Encoding: 8bitTesting the email class.//注意:很多敏感的我都改为 'XXXXXX' 了

Hex 发表于 2010-1-13 13:49:28

换其他 smtp,貌似这个 smtp 不允许你发邮件,推荐你用 QQ SMTP 我测试成功。

yinzhili 发表于 2010-1-13 15:54:24

看起来像是你用的这个SMTP服务器不允许你发邮件,换个试试。
页: [1]
查看完整版本: 用CI发送邮件不成功