Forum FAQForum FAQSearchSearch MemberlistMemberlist Forum ignore listForum ignore list RegisterRegister ProfileProfile Log in to check your private messagesLog in to check your private messages Log inLog in
mail - sto radim krivo? :/

 
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side
View previous topic :: View next topic  
Author Message
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 30.03.2005 20:32    Post subject: mail - sto radim krivo? :/ Add user to your forum ignore list Reply with quote

ovo je bila forma koja je prije bila redirectana na bravenet i sve je radilo kako treba.
Code:
<form action="sendmail.php" method="post" enctype="multipart/form-data">
                  <p class="form">
                    <input name="name" type="text" id="name2" value="name" size="50" maxlength="50" />
                  </p>
                  <p class="form">
                    <input name="email" type="text" id="email" value="e-mail adress" size="50" maxlength="50" />
                  </p>
                  <p class="form">
                    <input name="subject" type="text" id="subject" value="subject" size="50" maxlength="50" />
                  </p>
                  <p class="form">
                    <textarea name="message" cols="50" rows="5" id="message">please, enter your message here</textarea>
                  </p>
                  <p class="form">
                    <input type="submit" name="submit" value="Send" />
                    <img src="/images/blank.gif" alt="" width="140" height="10">
                    <input type="reset" name="clear" value="Clear" />
                  </p>
                </form>

pogledala sam na php.net primjere i sklepala sendmail.php koji izgleda ovako:
Code:
<?php

$message = $_POST['message'];
$subject = $_POST['subject'];
$headers = 'From: ' . $_POST['name'] . ' <' . $_POST['email'] . '>';

if (!mail('name@domain.com', $subject, $message, $headers)) {
   echo "Error sending mail.";
} else {
   header("Location: http://nelchee.freeprohost.com/index.php?go=thanku");
}
?>

uredno se pojavi thank you stranica, ali ja mail ne dobijem. ni u spam folder. mislila sam da se samim provjeravanjem funkcije da li radi ona i izvrsava pa se to salje... jel u tome problem, moram li ponovo pozvat funkciju?

p.s. da znam, to se sve lijepo moze u jednu stranicu slozit, i'll do it, samo da najprije proradi ovo..

Last edited by nel`chee on 21.12.2007 02:22; edited 1 time in total

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Sulien



Joined: 04 Jan 2004
Posts: 2905
Location: Zagreb

PostPosted: 30.03.2005 21:11    Post subject: Add user to your forum ignore list Reply with quote

ne brini se, čim napišeš ime funkcije sa zagradama (i argumentima) funkcija je pozvana... ne možeš provjeriti rezultat funkcije bez da se ona izvrši i vrati return value, zar ne? Wink

znači funkciju ne moraš još jednom zvati

što se tiče zašto mail ne stiže -- I have no clue Sad

samim time što je funkcija vratila 'true' znači da se dobro izvršila... i da je mail poslan Think

probaj sa nekom drugom e-mail adresom

ovo je moje što sam na brzinu jednom složio, nije neki uzor ali radi skroz dobro

Code:
$target_email = 'neki@mail';

$msgbody = stripslashes($_POST['message'])."\n\nPošiljaoc: {$_POST['company']}";

if($_POST['name']) $msgbody .= ", {$_POST['name']}";
if($_POST['tel']) $msgbody .= ", telefon: {$_POST['tel']}";
if($_POST['email']) $msgbody .= ", e-mail: {$_POST['email']}";
   
$msgbody .= "\n\n--\n\n IP: {$_POST['ip']} \n agent: {$_POST['httpagent']}";
   
if(mail($target_email,'* Kontakt sa weba *',$msgbody,
    "From: {$_POST['email']}\r\n"
    ."Reply-To: {$_POST['email']}\r\n"
    ."Content-Type: text/plain; charset=UTF-8\r\n"
    ."X-Mailer: PHP/" . phpversion() ))
  echo "<h2>Your message has been sent to $target_email</h2><p>Thank you for your confidence.</p>";
else echo '<h2>There has been an error while sending the message.</h2><p>If you see this for the first time, please try again.</p>';
Back to top
View user's profile Send private message Send e-mail Visit poster's website
che.UP
mi3.crew


Joined: 07 Sep 2003
Posts: 2320
Location: zagreb

PostPosted: 30.03.2005 21:27    Post subject: Add user to your forum ignore list Reply with quote

vrlo cestho hosteri znaju ogranicit mail funkciju tako da salje mail samo na njihove servere... ko fol zbog spama... tako da mozes pogledat na njihovom suport forumu (ako ga imaju) ili probat na neki mail na njihovom serveru poslat (ako ga imas)

_________________
UP | TypeTester | Accommodations App
Meni u Firefox-u ne radi AJAX
Back to top
View user's profile Send private message Visit poster's website
nel`chee



Joined: 08 Jul 2004
Posts: 2087
Location: Rijeka

PostPosted: 31.03.2005 21:07    Post subject: Add user to your forum ignore list Reply with quote

hm che.UP je u pravu.. isprobala sam skriptu na drugom serveru i tamo je proradilo, na ovom free nece... a na tom serveru nemam mail Confused

_________________
art & design portfoliofree Photoshop brushes stuffsketchblogfacebook
Back to top
View user's profile Send private message Visit poster's website Twitter profile
Display posts from previous:   
This forum is locked: you cannot post, reply to, or edit topics.   This topic is locked: you cannot edit posts or make replies.    mi3dot.org Forum Index -> Server-side All times are GMT + 1 Hour
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group