|
我用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' 了 |
|