SOS我正在尝试向选定的电子邮件发送消息(按表单发布),因此表单会将student_id传递给php脚本,该脚本获取相应的student_email地址(由student_id引用),我非常感谢您的帮助.这是我每次都得到的错误信息,
刷新无效:您必须至少提供一个收件人电子邮件地址.消息未发送PHP Mailer错误:您必须至少提供一个收件人电子邮件地址.
代码:
<?php require_once("connection.php"); ?>
<?php require_once("functions.php"); ?>
<?php require("class.phpmailer.php");?>
<?php
// START FORM PROCESSING
if( isset($_POST['submit'])) { // Form has been submitted.
$student = trim(mysql_prep($_POST['student']));
$re_mail =$student["email"];
$mail = new PHPMailer();
$mail->PluginDir = './';
$mail->IsSMTP();
$mail->Port = 465;
$mail->Host = "smtp.gmail.com";
$mail->IsHTML(true);
$mail->Mailer = "smtp";
$mail->SMTPSecure = "ssl";
$mail->SMTPAuth = true;
$mail->Username = "xxxxx@gmail.com";
$mail->Password = "xxxxxxxxxx";
$mail->SingleTo = true; // if you want to send mail to the users individually so that no recipients can …Run Code Online (Sandbox Code Playgroud) phpmailer ×1