蝎の紫 发表于 2011-10-3 21:51:44

email类

<?php

class Index extends CI_Controller {
        function __construct()
        {
          parent::__construct();
          header('Content-Type:text/html;charset=utf-8');
        }
       
        function index()
        {                
      $config['useragent'] = 'CodeIgniter';//用户代理
      $config['protocol'] = 'smtp';//邮件发送协议mail, sendmail, or smtp
      $config['smtp_host'] = 'smtp.qq.com';
      $config['smtp_user'] = '290601953';
      $config['smtp_pass'] = '*********';
      $config['smtp_port'] = 25;
      $config['smtp_timeout'] = 5;
      $config['wordwrap'] = TRUE;
      $config['mailtype'] = 'html';
      $config['charset'] = 'utf-8';
      $config['validate'] = TRUE;
      
      $this->email->initialize($config);
      
      $this->email->from('290601953@qq.com', '蝎紫');
      $this->email->to('751618126@qq.com');
      
      $this->email->subject('Email Test');
      $this->email->message('Testing the email class.');
      
      $this->email->send();
      
      echo $this->email->print_debugger();
       
        }

}
这是我的代码,我想知道为什么发不出呢?

baiyuxiong 发表于 2011-10-4 00:28:38

print_debugger输出啥信息?

Уаиɡ_輄 发表于 2011-12-7 21:59:48

我想你邮件可能被QQ邮箱给和谐了,你去垃圾箱看看。
我刚用你代码测试了下,我是成功了。
页: [1]
查看完整版本: email类