我在更改了我的Gmail密码后收到此错误。它以前工作过。
发生数据库错误
错误号码:1054'字段中的未知列'g-recaptcha-response' 列表'
INSERT INTO
tblsb_userqueries
(project_id
,username
,phone
,message
,g-recaptcha-response
)VALUES('0','演示', '0000','测试','03AJzQfVCDrIod2TLu')
文件名:models / Common_model.php 行号:8
这是我的PHPMailer代码:
<?php
require 'application/third_party/email/PHPMailerAutoload.php';
$mail = new PHPMailer;
//$mail->isSMTP(); // Set mailer to use SMTP
$mail->Host = 'smtp.gmail.com'; // Specify main and backup server
$mail->SMTPAuth = true; // Enable SMTP authentication
$mail->Username = 'demo@gmail.com'; // SMTP username
$mail->Password = 'Demo123#'; // SMTP password
$mail->SMTPSecure = 'ssl'; // Enable encryption, 'ssl' also accepted
$mail->Port = 587; //Set the SMTP port number - 587 for authenticated TLS
$mail->setFrom('noreply@gmail.com', 'header name'); //Set who the message is to be sent from
$mail->addAddress('demo1@gmail.com'); // Add a recipient
$mail->WordWrap = 50; // Set word wrap to 50 characters
$mail->isHTML(true); // Set email format to HTML
$mail->Subject = 'Here is the subject';
$mail->Body = 'This is the HTML message body <b>in bold!</b>';
$mail->AltBody = 'This is the body in plain text for non-HTML mail clients';
//Read an HTML message body from an external file, convert referenced images to embedded,
//convert HTML into a basic plain-text alternative body
$mail->msgHTML('Hi, This is my test email');
if(!$mail->send()) {
echo 'Message could not be sent.';
echo 'Mailer Error: ' . $mail->ErrorInfo;
exit;
}
echo 'Message has been sent';
?>
答案 0 :(得分:0)
尝试以下更改,需要将表字段名称更改为g_recaptcha_response
INSERT INTO tblsb_userqueries (`project_id`, `username`, `phone`, `message`, `g_recaptcha_response`) VALUES ('0', 'demo', '0000', 'test', '03AJzQfVCDrIod2TLu')