| 
 | 
 
代码如下 
在控制器内: 
$this->load->library ( 'email' ); 
$this->email->from ( SMTP_USER, USER_NAME ); 
$this->email->to ( $toList ); 
$this->email->subject ( MAIL_TITLE ); 
$this->email->message ( $mailContent ); 
 
在config/email.php内: 
<?php 
if ( ! defined('BASEPATH')) exit('No direct script access allowed'); 
//SMTP 端口 
$config ['smtp_port'] = 25; 
//邮件发送协议 
$config ['protocol'] = SMTP_PROC; 
// STMP服务主机地址 
$config ['smtp_host'] = SMTP_HOST; 
// STMP邮箱地址 
$config ['smtp_user'] = SMTP_USER; 
// STMP邮箱密码 
$config ['smtp_pass'] = SMTP_PASS; 
 
为什么到此发送邮件失败?但是为什么加上如下两行: 
$config['newline'] = "\r\n"; 
$config['crlf'] = "\r\n"; 
就能成功呢?(我开发用的win7系统) 
此外,如果想在linux服务器上发邮件能否成功呢?如果不能又该如何改动呢? 
在线等待各位高手指导,不胜感激! 
 |   
 
 
 
 |