【问题标题】:cannot send mail with Firefox and pear无法使用 Firefox 和 pear 发送邮件
【发布时间】:2013-10-08 14:24:46
【问题描述】:

我很困惑所以请耐心等待

我使用 pear 1.9.0,我有这个简单的发送电子邮件的代码。

 <script type='text/javascript'>
function contactsendBack(f){
   //mes is a div to render messages to the user
    document.getElementById("mes").innerHTML="";

   //if the user wants to input some mails to the textfiled, but the textfield is actually empty...
   if(f.elements['pick'].value=="opt"  && f.elements['sendm'].value=="" ){  document.getElementById("mes").innerHTML="Duh, no mails"; return false;}

   //if the user wants to input some mails to the textfiled and also include admin's mail to the list, but the textfield is actually empty...
   else if (f.elements['pick'].value=="admopt"&& f.elements['sendm'].value==""){document.getElementById("mes").innerHTML="Duh, no mails"; return false;}
   else
      {
                  //ok, no errors now, so send to server
             jQuery.post("contactsendBack.php", { 
              name : f.elements['name'].value ,
              mymail : f.elements['mymail'].value ,
              pick : f.elements['pick'].value ,
              sendm : f.elements['sendm'].value ,
              subj : f.elements['subj'].value ,
              comment : f.elements['comment'].value 


              }, function(data) {
             //render what  contactsendBack.php echos...could be "send ok" or "error"
              $('#mes').html(data);
               });   

       return false;

       }
    }

     </script>


//        the html
        <form  action="#"  onSubmit="return contactsendBack(this); return false;" method="post" enctype="multipart/form-data">   
        Name:<br>
        <input name="name" id="name" type="text" required ><br>
        Your e-mail:<br>
        <input name="mymail" id="mymail" type="email"  value="<?php echo $defm ?>" required ><br>

        <input type="radio" id="pick" name="pick" value="adm" checked = "checked">Admin<br>
        <input type="radio" id="pick" name="pick" value="opt">What I set to the textbox<br>
        <input type="radio" id="pick" name="pick" value="admopt">Admin AND What I set to the textbox<br>
        <input type="radio" id="pick" name="pick" value="all">Everyone<br>


        Set some mails:<br>You can input more than one mail. Separate by commas<br>
        <input name="sendm" id="sendm" type="textarea"  rows="24" cols="50"  ><br>

        Subject:<br>
        <input name="subj" id="subj" type="text"  required><br>
        Text :<br>
        <input name="comment" id="comment" type="textarea"  rows="24" cols="50"  required >
         <br>

         <input type="reset"  id="res" name="res"/>
         <input type="submit" id="sub" name="sub"/>
        </form>

这适用于 Chrome。回声“发送成功”,我可以在我的邮件帐户中看到一封新邮件。但在 Firefox 和 IE 中回显“send ok”,我的帐户中没有看到新邮件。

我也使用 j-query 1.8.2

我在 IE 和 FF 控制台中没有看到任何错误。

我只是不明白。与浏览器有关吗?服务器端(contactsendBack.php)?前端?

我该如何解决这个问题?

有什么想法吗?我卡住了

谢谢

【问题讨论】:

    标签: jquery html email xmlhttprequest pear


    【解决方案1】:

    检查您发布到脚本的值并比较不同的浏览器版本。可能会有差异 - 消除它。

    【讨论】:

      猜你喜欢
      • 2017-01-31
      • 2014-01-05
      • 2011-04-10
      • 2015-04-09
      • 1970-01-01
      • 2010-11-24
      • 2012-01-07
      • 2011-05-11
      相关资源
      最近更新 更多