john_zakaria Posted January 14, 2009 Share Posted January 14, 2009 in this php code the data is posted from a form and will be mailed to my e-mail but my problem is that when Using the php mail function with godaddy , i did not receive the mail the system is linux and for more details for phpinfo click on the following link http://projects.kayandco-egypt.com/untitled2_old.php really i need help to fix this problem today..... i tried to see many forums but i dont have the solutions yet i tried also to use phpmailer but it did not help me if anyone have a function or any solution for this problem plz send for me <? session_start(); header("Cache-control: private"); // IE 6 Fix if ($_POST["name"]) { foreach ($_POST as $key => $value) { $$key = trim($value); $_SESSION[$key . "_b"] = $value; // echo "Key: $key; Value: $value<br />\n"; } $kind = "mail"; $messageo = ' <html> <head> <style> body { font-family: Arial, Helvetica, sans-serif; font-size: 11px; color: #737373; text-align: justify; width: auto; margin-right: 0px; margin-left: 0px; margin-top: 10px; margin-bottom: 10px; line-height: 17px; } .padding { padding-left: 30px; background-color: #cdcdcd; color: #023061; height: 30px; vertical-align: middle; } .padding2 { padding-left: 30px; background-color: #E5E5E5; color: #023061; height: 30px; } .title1 { font-size: 17px; font-weight: bold; color: #023061; padding-top: 20px; padding-bottom: 25px; font-family: Arial, Helvetica, sans-serif; text-transform: uppercase; } </style> </head> <body> <div class="title1" align="center">mail</div> <table width="50%" border="0" cellspacing="1" cellpadding="4" align="center"> <tr class="padding"> <td width="30%"><strong>Name <b></strong> </td> <td >' . $name . '</td> </tr> <tr class="padding2"> <td ><strong>E-mail </strong> </td> <td >' . $emal . '</td> </tr> <tr class="padding"> <td><strong> City </strong> </td> <td>' .$city . '</td> </tr> <tr class="padding2"> <td><strong>Country</strong> </td> <td>'.$country.'</td> </tr> <tr class="padding"> <td><strong>Telephone</strong> </td> <td>' . $tel.'</td> </tr> </table> </body> </html> '; //echo $message; $headers .= "MIME-Version: 1.0\r\n"; $headers .= "Content-type: text/html; charset=windows-1256\r\n"; $headers .= "From: [email protected]>\r\n"; $headers .= "cc: [email protected]\r\n"; $ok = mail("[email protected]", $kind, $messageo, $headers); } header("Location: welcome.php"); ?> Link to comment https://forums.phpfreaks.com/topic/140771-mail-function-problem-linux-godaddy/ Share on other sites More sharing options...
ashell Posted January 20, 2009 Share Posted January 20, 2009 Looks like you have a typo after the foreach $$key should be $key Try that and see if it helps. Also, have errors turned on, that will usually point out stuff like this. Link to comment https://forums.phpfreaks.com/topic/140771-mail-function-problem-linux-godaddy/#findComment-741222 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.