Zend mail发送邮件
<?php/*
* Created on 2012-3-19
*
* To change the template for this generated file go to
* Window - Preferences - PHPeclipse - PHP - Code Templates
*/
include_once 'conn/conn.php';
require_once 'Zend/Mail.php';
require_once 'Zend/Mail/Transport/Smtp.php';
$reback='0';
$url='http://'.$_SERVER['SERVER_NAME'].dirname($_SERVER['SCRIPT_NAME']).'/activation.php';
$url.='?name='.trim($_GET['name']).'&pwd='.md5(trim($_GET['pwd']));
//发送激活邮件
$subject="激活码的获取";
$mailbody='注册成功。您的激活码是:'.'<a href="'.$url.'"target="_blank">'.$url.'</a><br>'.'请点击该地址,激活您的用户!';
//定义邮件内容
$envelope="dfl_beau@ //定义登录使用的邮箱
$tr=new Zend_Mail_Transport_Smtp('192.168.1.247'); //?????
$mail=new Zend_Mail();
$mail->addTo('cym3100@','获取用户注册激活码'); //?????
$mail->setFrom('cym3100@','明日科技典型模块程序测试邮箱,恭喜您用户注册成功!'); //?????
$mail->setSubject('获取注册用户的激活码'); //?????
$mail->setBodyHtml($mailbody); //?????
$mail->send($tr);
*/
/* 网络版发送邮件方法*/
$config=array('auth'=>'login','username'=>'mroft8888','password'=>'mrsoft8888'); //定义STMP的验证参数
$transport=new Zend_Mail_Transport_Smtp('smtp.',$config); //实例化验证对象
$mail=new Zend_Mail('GBK');
$mail->setBodyHtml($mailbody);
$mail->setFrom($envelope,'明日科技典型模块程序测试邮箱,恭喜您用户注册成功!');
$mail->addTo($_GET[email],'获取用户注册激活码');
$mail->setSubject('获取注册用户的激活码');
$mail->send($transport);
/*网络版发送邮件方法*/
$sql="insert into tb_member(name,password,email,question,answer)values('".trim($_GET['name'])."','".md5(trim($_GET['pwd']))."','".$_GET['email']."','".$_GET['question']."','".$_GET['answer']."')";
$num=$conne->uidRst($sql);
if($num==1){
$reback='1';
}
echo $reback;
?>
我是菜鸟,这段代码看得我头晕晕的,麻烦各位高手、前辈指点指点,最好详尽些每行帮我解析一下,感激不尽!谢谢