
smtp.php 类 在线发送邮件详细代码:
在发送邮件之前首先要先有一个开通了smtp服务的邮箱账号密码。
使用代码:
phpheader("Content-Type:text/html;Charset=utf-8"); require "smtp.php";$smtpserver = "smtp.163.com";$smtpserverport = 25;$smtpusermail = "发送邮箱账号";$smtpemailto = "接收邮箱账号";$smtpuser = "发送邮箱账号"; $smtppass = "发送邮箱密码"; $mailsubject = "邮箱主题";$mailbody = "邮箱内容"; $mailtype = "HTML";//发送$smtp = new smtp($smtpserver,$smtpserverport,true,$smtpuser,$smtppass); $smtp->debug = false;