|
发表于 2008-1-29 10:42:17
|
显示全部楼层
PHP复制代码 function mail(){
/*
mail config
*/
$config['protocol'] = 'smtp';//采用smtp方式,方便租用主机的用户
$config['smtp_host'] = 'smtp.126.com';
$config['smtp_user'] = 'mytest4126';//邮箱帐号为mytest4126@126.com
$config['smtp_pass'] = '******';
//$config['charset'] = 'iso-8859-1';
$config['charset'] = 'utf-8';
$config['wordwrap'] = TRUE;
$config['mailtype'] = "html";
$this->load->library('email');
$this->email->initialize($config);
$this->email->from('mytest4126@126.com', '我是发件人');
$this->email->to('foreveronline@163.com');//收件人
$this->email->subject('中文主题');
$this->email->message('这是中文的正文部分.');
if(!$this->email->send())
{
show_error ("发送mail时,发生错误!");
//echo $this->email->print_debugger();
exit;
}
} 复制代码 |
|