我用ci框架想实现发送邮件,问题是我用163的邮箱就可以,而用本公司的就不行,
ci对mail.xxx.com这种邮件服务器过敏吗?
邮件相关设置:$config['smtp_host'] = 'mail.XXXXXXX.com';
$config['smtp_user'] = '[email protected]';
$config['smtp_pass'] = '111111';
$config['charset'] = 'utf-8';
$config['protocol'] = 'smtp';
$config['smtp_port'] = '25'; 邮件发送代码:$this->load->library('email');

$this->email->from('[email protected]', '小熊');
$this->email->to('[email protected]');
$this->email->subject('Email Test');
$this->email->message('Testing the email class.');

$this->email->send();
echo $this->email->print_debugger();debug输出如下220 mxg5.hichina.com ESMTP server (quarkmail server - version 1.2.1) ready at Wed, 12 May 2010 16:13:49 +0800hello: 250-mxg5.hichina.com Hello localhost
250-SIZE 52428800
250-8BITMIME
250-PIPELINING
250-AUTH=LOGIN
250-AUTH LOGIN
250-STARTTLS
250 HELPfrom: 250 Okto: 250 Okdata: 354 Start mail input; end with .
The following SMTP error was encountered:
Unable to send email using PHP SMTP. Your server might not be configured to send mail using this method.

解决方案 »

  1.   

    phpmailer 用用,那个肯定行,ci中的email没用过..
    你这个错误讲的是. 不能使用smtp,你的服务器可能没有配置smtp发送email.
    最好看下ci的手册..那手册讲的很详细.或者去ci中国论坛上发. 应该能找到答案.
      

  2.   

    你本公司的服务器,是smtp的?还是sendmail的?
      

  3.   

    回楼上:是smtp的,之前试过别的邮件发送类,暂定现在先用phpmailer
      

  4.   

    phpmailer  这个比 ci 自带email类好用。