Niixie Posted March 13, 2011 Share Posted March 13, 2011 Hey, i've made this code thats supposed to email me. -It worked for some time ago, then i edited it and cant get it working again. <?php session_start(); //Gram slik udregning $gram_blandet = $_SESSION["blandet"]*40; $gram_ananas = $_SESSION["ananas"]*40; $gram_banan = $_SESSION["banan"]*50; $gram_jumbo = $_SESSION["jumbo"]*50; $gram_cashew = $_SESSION["cashew"]*30; $gram_pistacie = $_SESSION["pistacie"]*30; $gram_mandler = $_SESSION["mandler"]*30; $ialt = $gram_blandet+$gram_ananas+$gram_banan+$gram_jumbo+$gram_cashew+$gram_pistacie+$gram_mandler; //Kommentar ting if($_SESSION["kommentarer"] == "Skriv dem her") $comment = "Ingen"; else if(strlen($_SESSION["kommentarer"]) == 0) $comment = "Ingen"; else $comment = $_SESSION["kommentarer"]; //Email information $txt_message = ' <html> <body> <h2>Ordre på Kloneslik</h2> <p>'.$_SESSION["navn"].' har bestilt klone slik.</p><br /> <table border="0"> <tr> <td><h2>Forsendelses information</h2></td> </tr> <tr> <td width="350">Navn: </td> <td>'.$_SESSION["navn"].'</td> </tr> <tr> <td width="350">Addresse: </td> <td>'.$_SESSION["addresse"].'</td> </tr> <tr> <td width="350">Postnummer: </td> <td>'.$_SESSION["postnummer"].'</td> </tr> <tr> <td width="350">Telefon: </td> <td>'.$_SESSION["telefon"].'</td> </tr> <tr> <td><h2>Slik</h2></td> </tr> <tr> <td width="350">Blandet Mix 40g: </td> <td>'.$_SESSION["blandet"].'</td> </tr> <tr> <td width="350">Ananas 40g Tørrede: </td> <td>'.$_SESSION["ananas"].'</td> </tr> <tr> <td width="350">Banan 50g Tørrede: </td> <td>'.$_SESSION["banan"].'</td> </tr> <tr> <td width="350">Jumbo rosiner 50g: </td> <td>'.$_SESSION["jumbo"].'</td> </tr> <tr> <td width="350">Cashewnødder 30g Ristet og Saltet: </td> <td>'.$_SESSION["cashew"].'</td> </tr> <tr> <td width="350">Pistacienødder 30g Saltet: </td> <td>'.$_SESSION["pistacie"].'</td> </tr> <tr> <td width="350">Mandler 30g Ristet og saltet: </td> <td>'.$_SESSION["mandler"].'</td> </tr> <tr> <td><hr /></td> </tr> <tr> <td width="350">Poser ialt: </td> <td>'.$_SESSION["blandet"]+$_SESSION["ananas"]+$_SESSION["banan"]+$_SESSION["jumbo"]+$_SESSION["cashew"]+$_SESSION["pistacie"]+$_SESSION["mandler"].'</td> </tr> <tr> <td width="350">Gram slik ialt: </td> <td> '.$ialt.' </td> </tr> <tr> <td><h2>Andet</h2></td> </tr> <tr> <td>Yderligere kommentarer:</td> <td> '.$comment.' </td> </tr> </table> </body></html>'; $to = "[email protected]"; $subject = "Test"; $message = $txt_message; $headers = "From: Klone slikbestilling" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n"; mail($to,$subject,$message,$headers); ?> Its the first time i've tried to make a system like that, and it is in the top of the script. Can anyone tell me whats wrong with it? Link to comment https://forums.phpfreaks.com/topic/230550-somethings-wrong-with-my-email/ Share on other sites More sharing options...
anevins Posted March 13, 2011 Share Posted March 13, 2011 Do you get any error messages, notices, warnings? If so, what are they? Link to comment https://forums.phpfreaks.com/topic/230550-somethings-wrong-with-my-email/#findComment-1187141 Share on other sites More sharing options...
Niixie Posted March 13, 2011 Author Share Posted March 13, 2011 No, there are no warnings or errors at all. Thats whats weird :S Link to comment https://forums.phpfreaks.com/topic/230550-somethings-wrong-with-my-email/#findComment-1187143 Share on other sites More sharing options...
Niixie Posted March 13, 2011 Author Share Posted March 13, 2011 I donno why it doesnt print any error, it just doesnt do anything... Does anyone know why? Link to comment https://forums.phpfreaks.com/topic/230550-somethings-wrong-with-my-email/#findComment-1187151 Share on other sites More sharing options...
anevins Posted March 13, 2011 Share Posted March 13, 2011 Sorry, my knowledge with emails are through form post methods, not sessions. Link to comment https://forums.phpfreaks.com/topic/230550-somethings-wrong-with-my-email/#findComment-1187156 Share on other sites More sharing options...
Niixie Posted March 13, 2011 Author Share Posted March 13, 2011 Alright, i would be pleased if someone else answered Link to comment https://forums.phpfreaks.com/topic/230550-somethings-wrong-with-my-email/#findComment-1187162 Share on other sites More sharing options...
DavidAM Posted March 13, 2011 Share Posted March 13, 2011 You are missing the CR-LF pair after the From: header. $headers = "From: Klone slikbestilling\r\n" . "MIME-Version: 1.0\r\n" . "Content-Type: text/html; charset=ISO-8859-1\r\n"; Also, the value of the From: header has to be a valid email address on the sending server. (I'm guessing you took it out for this post, but just make sure it is there when you send it). Link to comment https://forums.phpfreaks.com/topic/230550-somethings-wrong-with-my-email/#findComment-1187172 Share on other sites More sharing options...
Niixie Posted March 14, 2011 Author Share Posted March 14, 2011 Can you show me what you mean? Link to comment https://forums.phpfreaks.com/topic/230550-somethings-wrong-with-my-email/#findComment-1187400 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.