发送邮件类。属于InitPHP框架扩展类,需要通过$this->getLibrary()方法获取
$email = $this->getLibrary('email');
$smtpserver = "smtp.sina.com";//SMTP服务器 $smtpserverport =25;//SMTP服务器端口 $smtpusermail = "xxxx@sina.com";//SMTP服务器的用户邮箱 $smtpemailto = "xxxx@qq.com";//发送给谁 $smtpuser = "xxxx@sina.com";//SMTP服务器的用户帐号 $smtppass = "xxxx";//SMTP服务器的用户密码 $mailsubject = "contact us";//邮件主题 $mailbody = "hello initphp框架
";//邮件内容 $mailtype = "HTML";//邮件格式(HTML/TXT),TXT为文本邮件 $smtp = $this->getLibrary('email');//加载email类 $smtp->config($smtpserver,$smtpserverport,true,$smtpuser,$smtppass); $smtp->debug = FALSE;//是否显示发送的调试信息 $smtp->sendmail($smtpemailto, $smtpusermail, $mailsubject, $mailbody, $mailtype); //发送邮件