多应用+插件架构,代码干净,二开方便,首家独创一键云编译技术,文档视频完善,免费商用码云13.8K 广告
index页面: ~~~ <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <title>Document</title> </head> <body> <form method="post" action="send_mail.php"> Your Email : <input type="text" name="mail_to"> <br/> Subject : <input type="text" name="mail_sub"> <br/> Message <input type="text" name="mail_msg"> <br/> <input type="submit" value="Send Email"> </form> </body> </html> ~~~ email发送功能页面: ~~~ <?php $mailto = $_POST['mail_to']; $mailSub = $_POST['mail_sub']; $mailMsg = $_POST['mail_msg']; require 'PHPMailer-master/PHPMailerAutoload.php'; $mail = new PHPMailer(); $mail ->IsSmtp(); $mail ->SMTPDebug = 0; $mail ->SMTPAuth = true; $mail ->SMTPSecure = 'ssl'; $mail ->Host = "smtp.gmail.com"; $mail ->Port = 465; // or 587 $mail ->IsHTML(true); $mail ->Username = "email@gmail.com"; //1.填写email账号 $mail ->Password = "password"; //2.填写email密码 $mail ->SetFrom("email@gmail.com"); //3.填写发送email地址 $mail ->Subject = $mailSub; // $mail ->Body = $mailMsg; $mail ->AddAddress($mailto); $mail->Body = "<center><h1>活动申请</h1></center><br/> <h3>Dear:</h3><br/> <h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;恭喜您申请成功,我们已经收到您的邮件!以下是您的填写内容:</h3><br/>" .$mailSub. "<br/> <h3>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;赠送给您的优惠卷:</h3><br/> <img src='http://h.hiphotos.baidu.com/image/pic/item/5fdf8db1cb134954aefa32a35c4e9258d0094a15.jpg' alt='image' />"; $mail->AltBody = "To view the message, please use an HTML compatible email viewer!"; //当邮件不支持html时备用显示,可以省略 if(!$mail->Send()) { header('Location: email-failure.php'); // 发送失败页面 } else { header('Location: email-success.php'); // 发送成功页面 } ~~~ email-failure页面: `email-failure.php` email-success页面: `email-success.php` 源码下载: 链接:https://pan.baidu.com/s/1oQqS602AZaUjBvDBDoABLA 密码:qls8