Witaj Gościu! ( Zaloguj | Rejestruj )

Forum PHP.pl

> Formularz do wysyłania maili na stronce, Nie działa z darmowymi kontami pocztowymi
tomaszs
post
Post #1





Grupa: Zarejestrowani
Postów: 2
Pomógł: 0
Dołączył: 5.12.2006

Ostrzeżenie: (0%)
-----


Od kilku lat korzystam z poniższego formularza do wysyłania maila ze strony i zawsze odbywało się to bez problemu. Wiadomość ze strony docierała na konto, które miałem na home.pl, potem na kylos.pl, teraz na az.pl czy też gmail.com

Umieściłem formularz na innej stronie gdzie wiadomość ma iść na onet i niestety nie dochodzi. To samo w przypadku podania adresu na interię czy wp.pl (IMG:http://forum.php.pl/style_emoticons/default/sad.gif)

Czy problem tkwi gdzieś w samym formularzu czy taką regorystyczną politykę antyspamową prowadzą firmy udostępniające darmowe konta pocztowe? - dodam, że wiadomość wysłana ze skryptu nie trafia do spamu. Nie znam się na php na tyle, aby doszukać się tu jakiegoś błędu. Proszę o pomoc.

formularz ma działać na sronce: http://www.laboratoriumbadawcze.com.pl/kontakt.php

a kod wygląda tak:

  1. <!--c1--><div class='codetop'>KOD</div><div class='codemain'><!--ec1-->
  2. <?
  3.                 if($s=="1") {
  4.         
  5.                 function SendMail($From,$FromName,$To,$ToName,$Subject,$tekst){ 
  6.                         
  7.                         global $count_att;
  8.                         global $attm;
  9.                         
  10.                         
  11.                         $OB="----=_OuterBoundary_000"; 
  12.                         $From or die("<p style="color:#000000;margin-top:10pt"><strong>Formularz kontaktowy:</strong><br>Brak adresu e-mail"); 
  13.                         $To or die("recipient address missing"); 
  14.                         $headers.="MIME-Version: 1.0n"; 
  15.                         $headers ="Subject: $Subjectn"; 
  16.                         $headers.="From: ".$FromName." <".$From.">n"; 
  17.                         $headers.="To: ".$ToName." <".$To.">n"; 
  18.                         $headers.="Reply-To: ".$FromName." <".$From.">n"; 
  19.                         $headers.="X-Priority: 1n"; 
  20.                         $headers.="X-MSMail-Priority: Highn"; 
  21.                         $headers.="X-Mailer: My php Mailern"; 
  22.                         $headers.="Content-Type: multipart/mixed;ntboundary="".$OB.""n";                                                 
  23.                         
  24.                         //Messages start with text/html alternatives in OB 
  25.                         $Msg.="n--".$OB."n"; 
  26.  
  27.                         $Msg.="Content-Type: text/plain;ntcharset="iso-8859-2"n"; 
  28.                         $Msg.="Content-Transfer-Encoding: quoted-printablenn"; 
  29.                         // plaintext goes here 
  30.                         $Msg.=$tekst."nn"; 
  31.                         
  32.                         
  33.                         
  34.                         // attachments
  35.                         $Msg.="n--".$OB."--n"; 
  36.                         $both=$headers.$Msg;
  37.                         $fd = @popen("/usr/sbin/sendmail -i -fnull@poczta.onet.pl -t", 'w'); 
  38.                         @fputs($fd, $both); 
  39.                         @pclose($fd); 
  40.                 }
  41.                 
  42.                 
  43.                 function EncodeSubject($subject) {
  44.                         $subject_length = strlen($subject);
  45.                         $encoded_subject = '=?iso-8859-2?Q?';
  46.                         if ($subject_length) {
  47.                                 for ($i = 0; $i < $subject_length; $i++) {
  48.                                         $char_code = ord($subject[$i]);
  49.                                         if ($char_code < 0x30 || ($char_code > 0x39 && $char_code < 0x41) || ($char_code > 0x5A && $char_code < 0x61) || $char_code > 0x7A) $encoded_subject .= '='.bin2hex($subject[$i]);
  50.                                         else $encoded_subject .= $subject[$i];
  51.                                 }
  52.                         }
  53.                         $encoded_subject .= '?=';
  54.                         return $encoded_subject;
  55.                 }
  56.                 
  57.                         $topic="Laboratorium Badawcze - Będzin";
  58.                         $topic=EncodeSubject($topic);
  59.                         
  60.                         $tekst="nnImię i nazwisko: $imie";
  61.                         $tekst.="nE-mail: $email";   
  62.                         $tekst.="nTresc maila: $tresc";
  63.                 
  64.  
  65.                         SendMail($email,$imie,"labbedzin@poczta.onet.pl","Laboratorium Badawcze - Będzin",$topic,$tekst);  
  66.  
  67.  
  68.                         echo "<p align=center><font face=Verdana, Arial, size=2 font color=#000000><strong>Dziękujemy. Wiadomość została wysłana. <br>Postaramy się o jak najszybszą odpowiedź.<br><br></p>";
  69.  
  70.         } else {
  71. ?>
  72.                    
  73.  
  74.  <script language="JavaScript" type="text/JavaScript">
  75. <!--
  76. function MM_findObj(n, d) { //v4.01
  77.   var p,i,x;  if(!d) d=document; if((p=n.indexOf("?"))>0&&parent.frames.length) {
  78.     d=parent.frames[n.substring(p+1)].document; n=n.substring(0,p);}
  79.   if(!(x=d[n])&&d.all) x=d.all[n]; for (i=0;!x&&i<d.forms.length;i++) x=d.forms[i][n];
  80.   for(i=0;!x&&d.layers&&i<d.layers.length;i++) x=MM_findObj(n,d.layers[i].document);
  81.   if(!x && d.getElementById) x=d.getElementById(n); return x;
  82. }
  83.  
  84. function MM_validateForm() { //v4.0
  85.   var i,p,q,nm,test,num,min,max,errors='',args=MM_validateForm.arguments;
  86.   for (i=0; i<(args.length-2); i+=3) { test=args[i+2]; val=MM_findObj(args[i]);
  87.     if (val) { nm=val.name; if ((val=val.value)!="") {
  88.       if (test.indexOf('isEmail')!=-1) { p=val.indexOf('@');
  89.         if (p<1 || p==(val.length-1)) errors+='- '+nm+' - zły format adresu.n';
  90.       } else if (test!='R') { num = parseFloat(val);
  91.         if (isNaN(val)) errors+='- '+nm+' must contain a number.n';
  92.         if (test.indexOf('inRange') != -1) { p=test.indexOf(':');
  93.           min=test.substring(8,p); max=test.substring(p+1);
  94.           if (num<min || max<num) errors+='- '+nm+' must contain a number between '+min+' and '+max+'.n';
  95.     } } } else if (test.charAt(0) == 'R') errors += '- wpisz '+nm+'n'; }
  96.   } if (errors) alert('Nie wypełniłeś wszystkich pól:n'+errors);
  97.   document.MM_returnValue = (errors == '');
  98. }
  99. //-->
  100.               </script><!--c2--></div><!--ec2-->


Ten post edytował tomaszs 5.12.2006, 18:43:16
Go to the top of the page
+Quote Post

Posty w temacie


Reply to this topicStart new topic
2 Użytkowników czyta ten temat (2 Gości i 0 Anonimowych użytkowników)
0 Zarejestrowanych:

 



RSS Aktualny czas: 21.09.2025 - 08:54