Papalex606 Posted May 13, 2007 Share Posted May 13, 2007 Hi guys, im having a really difficult time recieving any emails from my contact form. I got the contact work working perfectly, when you fill the fields out and select 'submit' it does just that, and confirms it with'Thankyou, your message was sent' however, when i check my email, i dont ever recieve anything from it! Im at a loss, i must have tried a hundred times, but still nothing. this is the code im currently using for my contact.php, can you see anything wrong with it: - <?php $your_company = $_GET['company']; $your_name = $_GET['name']; $your_phone = $_GET['phone']; $your_email = $_GET['email']; $your_message = $_GET['message']; $recipient_email = "info@darkiconstudios.com"; $subject = "from " . $your_email; $headers = "From: " . $your_name . " <" . $your_email . ">\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'; $content = "<html><head><title>Contact letter</title></head><body> "; $content .= "Company: " . $your_company . " "; $content .= "Name: " . $your_name . " "; $content .= "Phone: " . $your_phone . " "; $content .= "E-mail: " . $your_email . " "; $content .= $your_message; $content .= " </body></html>"; mail($recipient_email,$subject,$content,$headers, "-finfo@darkiconstudios.co.uk"); ?> <html> <body bgcolor="#282E2C"> <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold"> Your message was sent. Thank you. </div> </body> </html> <script>resizeTo(300, 300)</script> im ripping me hair out, trying to get this to work and im at a complete loss. Many thanxs. Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/ Share on other sites More sharing options...
ToonMariner Posted May 13, 2007 Share Posted May 13, 2007 if you are running this on your own machine makes sure you have your SMTP setting to the server that your service provider has... If this is on a live server then check your junk folder... Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252339 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 Oh ok, how would i do that? Sorry im a newbie! Im using thunderbird rather than outlook. Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252346 Share on other sites More sharing options...
boo_lolly Posted May 13, 2007 Share Posted May 13, 2007 Oh ok, how would i do that? Sorry im a newbie! Im using thunderbird rather than outlook. your mail client has nothing to do with your php script sending mail. are you using a local machine or have you purchased some server space online? is your server a windoze or linux machine? Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252354 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 im just using my computer at home, ive got hosted webspace and email accounts. Its a windows server. Thankyou Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252360 Share on other sites More sharing options...
boo_lolly Posted May 13, 2007 Share Posted May 13, 2007 in my opinion, if you're using php, you should be running linux. but that's just my opinion. are you testing your script on your home machine or on your windoze server over the net? Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252368 Share on other sites More sharing options...
Papalex606 Posted May 13, 2007 Author Share Posted May 13, 2007 i have no idea about different servers. lol. but im uploading the contact.php to the ftp server which is connected to my hosting site and then testing the websites URL and contact form online. ive done absolutly everything, ive been trying for two days to get this small contact form to work. i cant belive how difficult its been. Do you have any ideas how i can fix this, i know very little about this sort of stuff, im reletively new to it. Any help would be appreciated. Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252376 Share on other sites More sharing options...
john010117 Posted May 14, 2007 Share Posted May 14, 2007 Ok. So that means you're website is hosted by someone else. Contact the administrator, and see if they actually have SMTP enabled. Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252453 Share on other sites More sharing options...
clown[NOR] Posted May 14, 2007 Share Posted May 14, 2007 just a question.. have you tried using $_REQUEST instead of $_GET? Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252456 Share on other sites More sharing options...
irvieto Posted May 14, 2007 Share Posted May 14, 2007 Hi there... I read in php.net that in order to use "-fsomemail@domain.com" in mail function, the user must have the proper rights to allow the parameters( /etc/mail/trusted-users). Also,two things: 1- If in your headers you are specifiying 'From: Some one <somemail@domain>', why are you trying to override this header. with the parameter "-fsomemail@domain.com" ? Try without it. Im sure this can be cause. 2- Try to finish every line in your headers with "\r\n". Remember, check your bulk/spam mail folder. Sometimes emails coming from sendmail are considered spam. Good Luck. Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252561 Share on other sites More sharing options...
neel_basu Posted May 14, 2007 Share Posted May 14, 2007 The problem of \r\n would appear only if you are using Qmail or something like that that is strick SMTP server. As he use windows i dont think its sendmail. And as rvieto told try using just mail($recipient_email,$subject,$content,$headers) Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252640 Share on other sites More sharing options...
Papalex606 Posted May 14, 2007 Author Share Posted May 14, 2007 thanxs all of you for your help, your total legends and i really appreciate it. Is there anyway you could show me what you mean? If i paste the whole contact.php code here, could you possibly make the changes so that it runs smoothly with what what your saying. I dont know the first thing about php and im sure i'll end up causing additional problems. Its just a contact form from a flash template im trying to get working. The contact.php code is: - <?php $your_company = $_GET['company']; $your_name = $_GET['name']; $your_phone = $_GET['phone']; $your_email = $_GET['email']; $your_message = $_GET['message']; $recipient_email = "info@darkiconstudios.com"; $subject = "from " . $your_email; $headers = "From: " . $your_name . " <" . $your_email . ">\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'; $content = "<html><head><title>Contact letter</title></head><body> "; $content .= "Company: " . $your_company . " "; $content .= "Name: " . $your_name . " "; $content .= "Phone: " . $your_phone . " "; $content .= "E-mail: " . $your_email . " "; $content .= $your_message; $content .= " </body></html>"; mail($recipient_email,$subject,$content,$headers, " -finfo@darkiconstudios.com"); ?> <html> <body bgcolor="#282E2C"> <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold"> Your message was sent. Thank you. </div> </body> </html> <script>resizeTo(300, 300)</script> also, im using thunderbird rather than oulook and i cant find a 'junk' folder anywhere on there to check. Its really bizzare. Many thanxs guys. Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252716 Share on other sites More sharing options...
neel_basu Posted May 14, 2007 Share Posted May 14, 2007 first of all Use mail($recipient_email,$subject,$content,$headers); Instead of mail($recipient_email,$subject,$content,$headers, " -finfo@darkiconstudios.com"); Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252725 Share on other sites More sharing options...
Papalex606 Posted May 14, 2007 Author Share Posted May 14, 2007 Oh ok, ive done it. The code no looks like: - <?php $your_company = $_GET['company']; $your_name = $_GET['name']; $your_phone = $_GET['phone']; $your_email = $_GET['email']; $your_message = $_GET['message']; $recipient_email = "info@pavelockstudios.com"; $subject = "from " . $your_email; $headers = "From: " . $your_name . " <" . $your_email . ">\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'; $content = "<html><head><title>Contact letter</title></head><body> "; $content .= "Company: " . $your_company . " "; $content .= "Name: " . $your_name . " "; $content .= "Phone: " . $your_phone . " "; $content .= "E-mail: " . $your_email . " "; $content .= $your_message; $content .= " </body></html>"; mail($recipient_email,$subject,$content,$headers); ?> <html> <body bgcolor="#282E2C"> <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold"> Your message was sent. Thank you. </div> </body> </html> <script>resizeTo(300, 300)</script> is that correcT? what do you think i should do now neel? Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252766 Share on other sites More sharing options...
neel_basu Posted May 14, 2007 Share Posted May 14, 2007 Now test this code weather it is sending Mails or not. Dont forget to check your Junk Mail Folder. Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252774 Share on other sites More sharing options...
Papalex606 Posted May 14, 2007 Author Share Posted May 14, 2007 No it still has the ame problem, it says 'message sent' but when i check the inbox.....nothing still. any ideas? Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252788 Share on other sites More sharing options...
neel_basu Posted May 14, 2007 Share Posted May 14, 2007 YOu checked Junked Mail Box ?? Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252800 Share on other sites More sharing options...
Papalex606 Posted May 14, 2007 Author Share Posted May 14, 2007 yeah, there was nothing there either! Im soo depressed about it lol Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252804 Share on other sites More sharing options...
Papalex606 Posted May 14, 2007 Author Share Posted May 14, 2007 is there anything i need to have installed, anything i need to do to get this to work? Ive been told theres nothing wrong with my hosting server. (i checked jsut to see) so the only thing i can think is if the contact.php codes wrong or i havnt done something very important. What do you think neel? Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252810 Share on other sites More sharing options...
neel_basu Posted May 14, 2007 Share Posted May 14, 2007 ...................................................... $content = str_replace("\n", "\r\n", $content);//Add this before mail() $headers = str_replace("\n", "\r\n", $headers);//Add this before mail() mail($recipient_email,$subject,$content,$headers); ........................................................... If its doesn't work a separate medecine will be applied. EDITED Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252813 Share on other sites More sharing options...
Papalex606 Posted May 14, 2007 Author Share Posted May 14, 2007 is this wwhat you meant neel? im not sure to apply that code! <?php $your_company = $_GET['company']; $your_name = $_GET['name']; $your_phone = $_GET['phone']; $your_email = $_GET['email']; $your_message = $_GET['message']; $recipient_email = "info@pavelockstudios.com"; $subject = "from " . $your_email; $headers = "From: " . $your_name . " <" . $your_email . ">\n"; $headers .= 'Content-type: text/html; charset=iso-8859-1'; $content = "<html><head><title>Contact letter</title></head><body>"; $content .= "Company: " . $your_company . ""; $content .= "Name: " . $your_name . ""; $content .= "Phone: " . $your_phone . ""; $content .= "E-mail: " . $your_email . ""; $content .= $your_message; $content .= "</body></html>"; $content = str_replace("\n", "\r\n", $content); $headers = str_replace("\n", "\r\n", $headers); mail($recipient_email,$subject,$content,$headers); ?> <html> <body bgcolor="#282E2C"> <div align="center" style="margin-top:60px;color:#FFFFFF;font-size:11px;font-family:Tahoma;font-weight:bold"> Your message was sent. Thank you. </div> </body> </html> <script>resizeTo(300, 300)</script> Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252823 Share on other sites More sharing options...
neel_basu Posted May 14, 2007 Share Posted May 14, 2007 Ya have you tested that ?? Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252828 Share on other sites More sharing options...
Papalex606 Posted May 14, 2007 Author Share Posted May 14, 2007 yeah nothing different has happened. Still recieve nothing. Man i appreciate you taking the time to help me with this. Its dragged on for soo long.! Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252833 Share on other sites More sharing options...
neel_basu Posted May 14, 2007 Share Posted May 14, 2007 Ok now Its Time to Use that Booster dose Go to http://zigmoyd.net and Download the Previous Version(1.0.0.1) We will use its mail Class And It does not uses PHP's mail(). See this Page on How to use this mail Class http://zigmoyd.sourceforge.net/man/mail.php#mail And See this for Installation Instruction on http://zigmoyd.sourceforge.net/man/index.php $fw_install_loc_dir_name To "/tf/fw" not "\tf\fw". Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252839 Share on other sites More sharing options...
neel_basu Posted May 14, 2007 Share Posted May 14, 2007 One Example Code is shown on the Installation Instruction Page ------------------------------------------------------------ I am just adding some Hacks to detect Where is the Error <?php header("Content-Type: text/plain"); include_once('fw/config.php'); include_once('fw/mail/mail.php'); include_once('fw/mail/template.php'); include_once('fw/done.php'); $mail = new mail("admin@localhost", "Subject", "Mail Body"); $mail->show_cnv = true;//I've Added this Simple Hack if($mail->send()) { echo "Mail Sent Succfully\n"; } else { echo "Sorry Mail Sending Failed\n"; print_r($mail->error);//Print The Errors } ?> Quote Link to comment https://forums.phpfreaks.com/topic/51230-can-anyone-tell-me-why-i-dont-recieve-mail/#findComment-252844 Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.