php attach server problem

php attach server problem

offline
  • Pridružio: 18 Dec 2007
  • Poruke: 95

imam problem skripta sa attach-om koja mi je radila do skoro tj. dok provider nije updetovao neke stvari. Sad odjednom nece jer je najverovatnije problem tj. sigurno problem u delu za attach. evo skripte:
$to = $_REQUEST['sendto'] ; $from = $_REQUEST['Email'] ; $ime = $_REQUEST['ime'] ; $headers = "From: $from"; $subject = "Obrazac"; $fields = array(); $fields{"ime"} = "ime"; $fields{"APR"} = "APR"; $fields{"PIB"} = "PIB"; $fields{"naziv"} = "naziv"; $fields{"mesto"} = "mesto"; $fields{"adresa"} = "adresa"; $fields{"postf"} = "postf"; $fields{"delatnost"} = "delatnost"; $fields{"tel1"} = "tel1"; $fields{"tel2"} = "tel2"; $fields{"tel3"} = "tel3"; $fields{"Email"} = "Email"; $fields{"sajt"} = "sajt"; $fields{"Message"} = "Message"; $body = "Primili smo sledeće podatke:\n\n"; foreach($fields as $a => $b){ $body .= sprintf("%20s: %s\n",$b,$_REQUEST[$a]); } $headers2 = "From: administrator@marketserbia.net"; $subject2 = "Obrazac je uspešno poslat"; $autoreply = "Vaš zahtev je na obradi!"; //Gather file data and other things $tmp = $_FILES['logo']['tmp_name']; $sep = md5(time()); $filename = $_FILES['logo']['name']; $filedata = file_get_contents($tmp); //Get file contents $fdata = chunk_split(base64_encode($filedata)); //Encode data into text form $to = "administrator@marketserbia.net"; //Email address to send this to //Determine mime type $ext = explode('.', $filename); $ext = $ext[1]; if($ext == "JPG" || $ext == "jpg" || $ext == "JPEG" || $ext == "jpeg") { $mime_type = "image/jpg"; } elseif($ext == "gif" || $ext == "GIF") { $mime_type = "image/gif"; } elseif($ext == "" || $ext == "") { $mime_type = "image/"; } else { exit("Error: Wrong file type!"); } //Begin the message.  Be sure to change this how you want it. $message = "Email message here"; //Begin the headers $headers = "From:{$from} MIME-Version: 1.0 Content-Type: Multipart/Mixed;   boundary=\"$sep\" charset=\"iso-UTF-8\" Content-Transfer-Encoding: 7bit --$sep Content-Type: $mime_type;   name=\"$filename\" Content-Transfer-Encoding: base64 Content-Disposition: attachment;     filename=\"$filename\" $fdata --$sep"; if($from == '') {print "Niste uneli vaš email, molimo pokušajte ponovo";} else { if($ime == '') {print "Niste uneli vaše ime, molimo pokušajte ponovo";} else{ $send = mail($to, $subject, $body, $headers); $send2 = mail($from, $subject2, $autoreply, $headers2); if($send) {print "Obrazac je uspešno poslat!";} else {print "Problem u slanju e-mail-a, obavestite nas na administrator@marketserbia.net"; } } }



Registruj se da bi učestvovao u diskusiji. Registrovanim korisnicima se NE prikazuju reklame unutar poruka.
Ko je trenutno na forumu
 

Ukupno su 937 korisnika na forumu :: 31 registrovanih, 6 sakrivenih i 900 gosta   ::   [ Administrator ] [ Supermoderator ] [ Moderator ] :: Detaljnije

Najviše korisnika na forumu ikad bilo je 3466 - dana 01 Jun 2021 17:07

Korisnici koji su trenutno na forumu:
Korisnici trenutno na forumu: aramis s, bbogdan, Brok, cifra, Djokislav, drimer, esx66, Gall, HrcAk47, ikan, ivica976, Kibice, kolle.the.kid, Koridor, ksyyaj, laurusri, ljuba, marsovac 2, nenad81, nikoladim, panzerwaffe, procesor, RecA, sokars, Srle993, Sumadija34, vandrej, VP6919, zlaya011, šumar bk2, 125