Jump to content

Duofilm

Members
  • Posts

    15
  • Joined

  • Last visited

    Never

Everything posted by Duofilm

  1. I'm not sure I understand what you mean ? You mean to post the email ? that ppl are recieving ? completly ?
  2. I changed the From to a valid email adres that is in use even. It doesn't change anything
  3. I looked it up made some minor changes... Since there wasn't much to change according to what I found on the internet. <?php $fromemail="No-Reply <ikwerkthuis.be>"; // change here if you want $toemail=$naarwie; // change here if you want $sub="Online info aanvraag"; // change here if you want $contentmsg="blabla" $success_page_name="bedankt.html"; $headers = "From:".$fromemail.""; $headers .= "MIME-Version: 1.0"; $headers .= "Content-type: text/html; charset=iso-8859-1"; @mail($toemail,$sub,$contentmsg,$headers); ?> Its still doesn't send to all emails some work some don't.. any other ideas ? or anything wrong with my headers here ?
  4. As my titel indicates, I have a problem with a piece of code I wrote some time ago. Everything in my mail form is fine and the mails do get send. But they don't always arrive (checked spam folder). Hotmail or example arrives but a normal email adres from a provider does not. Could this have something to do with SMTP ? could I add this to my code ? I tryed some but so far it does not work, In the code below you can see my working code as it is & the tests I tryed and didn't work out that well. <?php $fromemail="No-Reply <ikwerkthuis.be>"; // change here if you want $toemail=$naarwie; // change here if you want $sub="Online info aanvraag"; // change here if you want $success_page_name="bedankt.html"; ////// do not change in following if($_SERVER['REQUEST_METHOD']=="POST") { $fieldnm_1=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_1'])); $fieldnm_2=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_2'])); $fieldnm_3=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_3'])); $fieldnm_4=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_4'])); $fieldnm_5=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_5'])); $fieldnm_6=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_6'])); $fieldnm_7=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_7'])); $contentmsg=stripslashes('<br><b><font style=color:#CC3300>'. $sub .'</font></b><br> <table width=708 border=0 cellpadding=2 cellspacing=1 bgcolor=#CCCCCC> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Voornaam *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_1 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Achternaam *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_2 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>E-mail *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_3 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Telefoon *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_4 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Werkstatus *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_5 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Leeftijd *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_6 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Regio *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_7 .'</td> </tr> </table><br> Contactpersoon: '. $naarwie .'<br> IP: '. $IP .'<br> Date: '. $DATE .'<br> Time: '. $TIME .' '); //// $headers = "MIME-Version: 1.0 "; $headers .= "Content-type: text/html; charset=iso-8859-1 "; $from=$fromemail; $headers .= "From: ".$from." "; @mail($toemail,$sub,$contentmsg,$headers);?> The code below is the code I tryed to apply to the code above that work. <?php $fromemail="No-Reply <noreply@ikwerkthuis.be>"; // change here if you want $toemail=$naarwie; // change here if you want $sub="Online info aanvraag"; // change here if you want $success_page_name="bedankt.html"; $host = "ikwerkthuis.be"; $username = "noreply@ikwerkthuis.be"; $password = "hl2012"; ////// do not change in following if($_SERVER['REQUEST_METHOD']=="POST") { $fieldnm_1=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_1'])); $fieldnm_2=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_2'])); $fieldnm_3=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_3'])); $fieldnm_4=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_4'])); $fieldnm_5=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_5'])); $fieldnm_6=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_6'])); $fieldnm_7=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_7'])); $contentmsg=stripslashes('<br><b><font style=color:#CC3300>'. $sub .'</font></b><br> <table width=708 border=0 cellpadding=2 cellspacing=1 bgcolor=#CCCCCC> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Voornaam *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_1 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Achternaam *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_2 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>E-mail *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_3 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Telefoon *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_4 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Werkstatus *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_5 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Leeftijd *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_6 .'</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Regio *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>'. $fieldnm_7 .'</td> </tr> </table><br> Contactpersoon: '. $naarwie .'<br> IP: '. $IP .'<br> Date: '. $DATE .'<br> Time: '. $TIME .' '); //// $headers = "MIME-Version: 1.0 "; $headers .= "Content-type: text/html; charset=iso-8859-1 "; $from=$fromemail; $headers .= "From: ".$from." "; $smtp = Mail::factory('smtp', array ('host' => $host, 'auth' => true, 'username' => $username, 'password' => $password)); @mail = $smtp->send($toemail,$sub,$contentmsg,$headers); ?> I hope someone can help me out. Thanks in advance !
  5. Hi, This is currently my code that generates a mail to me with all info the user provided in the form on the site. + it sends a auto reply to the user with details in it. I'd like to keep both emails stored in a log file for future use. Is this possible ? is it hard to add ? I've got no clue Anyone could help ? <?php ob_start(); include_once('verbinding.php'); $result1 = mysql_fetch_array (mysql_query("SELECT COUNT(*) FROM `Clicks` WHERE Aan = '0'")); // controleren hoeveel rijen er zijn met "Aan" op 0 $lijst1 = $result1[0]; if($lijst1=='0') { // als de lijst leeg is wil dit zeggen dat ze allemaal op 1 staan en mogen ze gereset worden. mysql_query("UPDATE `Clicks` SET `Aan`= '0' WHERE `Aan`='1'"); } // indien er ook maar 1 veld op 0 staat zal er direkt naar hier worden gesprongen $result = mysql_fetch_array(mysql_query("SELECT ID,Email FROM `Clicks` WHERE Aan = '0' ORDER BY RAND() LIMIT 1")); $naarwie = $result['Email']; $ID = $result['ID']; echo $ID; echo $naarwie; mysql_query("UPDATE `Clicks` SET `Aan`= '1' WHERE ID = '$ID'"); mysql_close($verbinding); // Sluit de verbinding. // We hebben hem nu niet meer nodig. $fromemail="No-Reply <ikwerkthuis.be>"; // change here if you want $toemail=$naarwie; // change here if you want $sub="Online info aanvraag"; // change here if you want $success_page_name="bedankt.html"; ////// do not change in following if($_SERVER['REQUEST_METHOD']=="POST") { $fieldnm_1=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_1'])); $fieldnm_2=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_2'])); $fieldnm_3=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_3'])); $fieldnm_4=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_4'])); $fieldnm_5=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_5'])); $fieldnm_6=str_replace ( array("\n"), array("<br>"),trim($_REQUEST['fieldnm_6'])); $contentmsg=stripslashes("<br><b><font style=color:#CC3300>$sub</font></b><br> <table width=708 border=0 cellpadding=2 cellspacing=1 bgcolor=#CCCCCC> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Voornaam *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_1</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Achternaam *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_2</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>E-mail *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_3</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Telefoon *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_4</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Werkstatus *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_5</td> </tr> <tr> <td width=165 align=right valign=top bgcolor=#FFFFFF><B>Leeftijd *:</b> </td> <td width=565 align=left valign=top bgcolor=#FFFFFF>$fieldnm_6</td> </tr> </table> "); //// $headers = "MIME-Version: 1.0 "; $headers .= "Content-type: text/html; charset=iso-8859-1 "; $from=$fromemail; $headers .= "From: ".$from." "; @mail($toemail,$sub,$contentmsg,$headers); $IP = $_SERVER['REMOTE_ADDR']; $DATE = date("Y-m-d"); $TIME = date("H:i:s"); $NameOfSender = $fieldnm_1; $SurnameOfSender = $fieldnm_2; //$emailadd = $naarwie; $headers2 = "MIME-Version: 1.0 "; $headers2 .= "Content-type: text/html; charset=iso-8859-1 "; $from=$naarwie; $headers2 .= "From: ".$from." "; $email = $fieldnm_3; // use their addy instead of yours $subject = 'ikwerkthuis.be inloggegevens introductie film'; // change subject $text = 'Beste '. $NameOfSender .' '. $SurnameOfSender .',<br> <br> Welkom bij <A HREF="ikwerkthuis.be" TABINDEX="4">ikwerkthuis.be</A>.<br> Hieronder vind U de logingevens voor het bekijken van de introductiefilm:<br> <br> Adres: <A HREF="http://ikwerkthuis.be/index.php/introductie" TABINDEX="4">http://ikwerkthuis.be/index.php/introductie</A><br> Gebruikersnaam: introductie<br> Paswoord: film2012<br> <br> '. $contentmsg .'<br> <br> Wij nemen spoedig contact met u op.<br> <br> Met vriendelijke groeten,<br> Het ikwerkthuis.be team<br> <br> IP: '. $IP .'<br> Date: '. $DATE .'<br> Time: '. $TIME .''; // change text mail($email, $subject, $text,$headers2); // send another one out header("Location:$success_page_name"); } ?>
  6. nvm I found the problem,... was a CAPSLOCK problem
  7. That seemed to work thanks alot ! Do you happen to know why my date & Time are not showing ? $DATE = date("Y-m-d"); $TIME = date("H:i:s"); this is correct no ?
  8. $IP = $_SERVER['REMOTE_ADDR']; $DATE = date("Y-m-d"); $TIME = date("H:i:s"); $NameOfSender = "BLABLABLABALLA"; $email = $fieldnm_3; // use their addy instead of yours $subject = 'ikwerkthuis.be inloggegevens introductie film'; // change subject $text = 'Beste $NameOfSender, Welkom bij ikwerkthuis.be. Hieronder vind U de logingevens voor het bekijken van de introductiefilm: Adres: http://ikwerkthuis.be/index.php/introductie Gebruikersnaam: introductie Paswoord: film2012 %DataOfForm% Wij nemen spoedig contact met u op. Met vriendelijke groeten, Het ikwerkthuis.be team IP: $IP Date: $Date Time: $Time'; // change text mail($email, $subject, $text, 'From: '.$emailadd.''); // send another one out header("Location:$success_page_name"); } ?>
  9. Thx I did in the meanwhile and it works ! I found my problem. I use a auto generated email form & added that code to the file. It works without all the code from the auto generated form. But when the code is in the file. It doesn't work properly changes the wrong fields or to many fields Don't really feel like checking the auto generated code so to bad i guess i'll have to find another way.
  10. Hi, me again its been a while and i've been trying to make the code more simpel. include_once('verbinding.php'); $result1 = mysql_fetch_array (mysql_query("SELECT COUNT(*) FROM `Clicks` WHERE Aan = '0'")); // controleren hoeveel rijen er zijn met "Aan" op 0 $lijst1 = $result1[0]; if($lijst1=='0') { // als de lijst leeg is wil dit zeggen dat ze allemaal op 1 staan en mogen ze gereset worden. mysql_query("UPDATE `Clicks` SET `Aan`= '0' WHERE `Aan`='1'"); } // indien er ook maar 1 veld op 0 staat zal er direkt naar hier worden gesprongen $result = mysql_fetch_array(mysql_query("SELECT Email FROM `Clicks` WHERE Aan = '0' ORDER BY RAND() LIMIT 1")); $naarwie = $result['Email']; echo $naarwie; mysql_query("UPDATE `Clicks` SET `Aan`= '1' WHERE Email = '$naarwie'"); mysql_close($verbinding); This should work right ? but it seems that the wrong Emails are changing from 0 to 1 or sometimes more then 1 are changing got any idea ?
  11. nope you didn't miss the point ^^ thats exactly what should happen. If it works for you that means i'm doing something wrong :'(
  12. @ batwimp Well I'll give it another go explaining. We have this site. Where we are testing everything, http://test-labs2.be When you go to the last tab on this site named "INFO AANVRAAG" you can ask for more information about the subject of the site. Whenever a person asks for this information this form needs to be send to a email adress. But to avoid it sending the information form always to the same person we made a Wheel( just what we call it). This Wheel in reality is acctually just the Table "Clicks" in the database with different Email adresses. When a person fills in the information form it randomly picks a email and sends it to that person the field value "aan" linked to that email adress will then change from value 0 to value 1 This way the program knows that this email adres has been used. Next time someone fills in the form he will again send it to a random email adress in the table BUT ! not to the person(s) that have the "Aan" value on 1. So if the table has 10 emails the form will stop sending after 10 persons have asked extra information oon the site. Thats why after all the emails have their "Aan" value on 1 it needs to check that and reset all of them back to 0 so we can again start from scratch. I hope this was better explained. @ Drummin I implemented the code. But when I try using the form on the site. The value's of the "Aan" field don't change from 0 to 1 or if they are all already on 1 they don't change to 0 again. I do get the email so it does find the fields & the querys are all correct since i tested them in the php my admin. I'm not sure what i'm doing wrong... Hope you guys or someone else got some more idea's been working on it for a while now.
  13. The link doesn't seem to be working properly. here you can see the picture. http://imageshack.us/f/525/phpdatabase.jpg/
  14. Hi, we are trying to make a marketing wheel. This means we got a database with lots of persons in it each with a individual email adres. The simel example of how the basic database looks is seen in the picture below. This table is called "Clicks" As you might notice the field "Aan" is either a 0 or a 1. This is how it works, when someone fills in a form on the website asking for more information the form with all the personal information of this person is send to a random email adres found in this table. When this happens the field "Aan" changes from 0 to 1 this way we can make sure that the same person does not get a email again until everyone else has been used 1 time. So in other words until that the field "Aan" is value 1 for every person in the table. As you might have guessed this is sadly enough not working ... this is our code : include_once('connection.php'); $data = array(); $i = 0; $result1 = mysql_query("SELECT * FROM `Clicks` WHERE Aan = 0"); while ($list1 = mysql_fetch_array($result1,MYSQL_ASSOC)) { if (empty($list1) ){ mysql_query("UPDATE `Clicks` SET `Aan`= 0 WHERE `Aan` = 1"); } $result = mysql_query("SELECT * FROM `Clicks` WHERE Aan = 0 ORDER BY RAND() LIMIT 1"); while ($list = mysql_fetch_array($result,MYSQL_ASSOC)) { foreach ($list as $key => $value) { // Met htmlentities() voorkom je dat html wordt uitgevoert. $value = htmlentities($value); $data[$i][$keyl] = $value; } $i++; } } mysql_free_result($result); $data = array_reverse($data); // Zet de nieuwste berichten bovenaan // in plaats van onderaan. $cnt = count($data); for($i = 0; $i < $cnt; ++$i) { $bericht = $data[$i]; echo(nl2br($bericht['bericht'])); // Met nl2br() worden alle enters in het // bericht omgezet naar <br/>. echo('</td></tr></table>'); $naarwie= $bericht['Email']; }mysql_query("UPDATE `Clicks` SET `Aan`= 1 WHERE `Email` = $naarwie"); mysql_close($Verbinding); // Sluit de verbinding. // We hebben hem nu niet meer nodig. So this code in short explained would be. It checks if all the "Aan" fields are on 0 if the list is empty so it means they are all on 1 he will reset all the fields of every user to 0. and then he will take a random person out and send the email to that person. And after the mail is send will change that person his value on "Aan" to value 1. Now if the list is not empty, that means there are still persons with value 0 in the list. Then he will take a random user out of all the persons who have "Aan" with value 0 send the mail to that user and change his "Aan" value to 1. This process will be repeated every time someone asks for information until all values of all users are on 1. And then again he will change them to 0 for everyone. I hope its clear what we are looking for. And I hope someone can help us out. We are clueless...
×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.