我有这个代码:
html:
<input id="register_username" type="text">
<input id="register_password" type="text">
<input id="register_repeatpassword" type="text">
<input id="register_email" type="text">
Run Code Online (Sandbox Code Playgroud)
Jquery:
$(document).ready(function(){
$('#register_username').attr('autocomplete','off');
$('#register_password').attr('autocomplete','off');
$('#register_repeatpassword').attr('autocomplete','off');
$('#register_email').attr('autocomplete','off');
});
Run Code Online (Sandbox Code Playgroud)
我想禁用某些浏览器的自动完成功能,并且实际上让用户键入整个字段但代码不起作用,下拉菜单仍然出现,用户仍然可以选择之前键入的内容.我也尝试过用户,autocomplete="off"
但什么都没发生.我在这做错了什么?
大家好,我收到此错误:
以下发件人地址失败:username_from@gmail.com : Called Mail() without being connected
<?php
require("PHPMailer/class.phpmailer.php");
$msg = 'hello world!';
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->Host = 'smtp.gmail.com';
$mail->Port = 465;
$mail->SMTPAuth = true;
$mail->Username = 'username@gmail.com';
$mail->Password = 'password';
$mail->SMTPSecure = 'ssl';
$mail->From = 'username_from@gmail.com';
$mail->FromName = 'My name';
$mail->AddAddress('other_user@gmail.com', '');
$mail->WordWrap = 50;
$mail->IsHTML(true);
$mail->Subject = 'hello';
$mail->Body = $msg;
if(!$mail->Send()){
echo "Mailer Error: " . $mail->ErrorInfo;
}
else{
echo "Message has been sent";
}
?>
Run Code Online (Sandbox Code Playgroud)
我该如何解决?谢谢!我使用 Gmail 邮件服务器从在 PHP 中运行 XAMPP 的本地主机发送电子邮件。