Tag: phpmailer

检测PHP Mailer错误并使用jquery在网站中打印消息

我正在使用PhpMailer发送电子邮件。 在我自己的脚本中,我想在下面的if语句中解析一些javascript。 请注意,我已启用html。 当没有发送电子邮件时,我想在.done函数中解析一些未发送电子邮件的javascript。 例如complete.html(“Message Not Sent!”); 发送电子邮件时,我想显示电子邮件已发送。 我怎么能这样做,哪里更好,在PHP文件内或在JavaScript中? var form = $(‘#contact’); form.submit(function(event) { event.preventDefault(); var complete = $(‘#formAppend’); var $form = $(this); var name = $(“#fname”).val(); var email = $(“#email”).val(); var Message = $(“#msg”).val(); var countryoption = $(“#country”).val(); $.ajax({ type: ‘POST’, url: ‘../sendemail.php’, data: { Name: name, Email: email, message: Message, Country: countryoption […]

PHPpost中未定义的索引

我拿一个表单并在jquery中进行变量检查然后将其传递给ajax中的php文件,但我收到了这个通知 注意:未定义的索引:第3行的C:\ xampp \ htdocs \ process.php中的your_name这里有问题注意:未定义的索引:第7行的C:\ xampp \ htdocs \ process.php中的your_email 这是我的jquery代码 $(“.button”).click(function(){ $(‘.error’).hide(); var your_email=$(“input#your_email”).val(); if(your_email ==””){ $(“label#youremail_error”).show(); $(“input#your_email”).focus(); return false; } var your_name=$(“input#your_name”).val(); if(your_name==””){ $(“label#yourname_error”).show(); $(“input#your_name”).focus(); return false; } var friends_email=$(“input#friends_email”).val(); if(friends_email==””){ $(“label#friendsemail_error”).show(); $(“input#friends_email”).focus(); return false; } var friends_name=$(“input#friends_name”).val(); if(friends_email==””){ $(“label#friendsname_error”).show(); $(“input#friends_name”).focus(); return false; } var dataString = ‘your_email=’ + your_email + […]