cyclo3000 Posted January 5, 2009 Share Posted January 5, 2009 Hi I'm having trouble with my PHP coding. I had a developer develop my site (flash site) and I'm using Godaddy as my hosting provider and I'm using the Windows IIS7 (which according to Godaddy supports PHP). However the developer says his coding is correct and that the issue is coming from Godaddy. My site is www.jsilvers.com and I have in the PHP code for my contact page to send all messages to my AOL email account. However when I try to send a message I do not recieve any emails or spam emails. Can someone please take a look at the PHP code and let me know if there are any errors. (see below) Thanks Josh <? $name=$_POST['name']; $email=$_POST['email']; $phone=$_POST['phone']; $message=$_POST['message']; $ToEmail = "cyclo3000@aol.com"; $ToSubject = "Message from your site"; $EmailBody = "Name: $name\n Email: $email\n Phone: $phone\n Message: $message\n"; $Message = $EmailBody; $headers .= "Content-type: text; charset=iso-8859-1\r\n"; $headers .= "From:".$name." / ".$email."\r\n"; mail($ToEmail,$ToSubject,$Message, $headers); ?> Quote Link to comment Share on other sites More sharing options...
rhodesa Posted January 5, 2009 Share Posted January 5, 2009 does it work if you remove this line? $headers .= "From:".$name." / ".$email."\r\n"; Quote Link to comment Share on other sites More sharing options...
slushpuppie Posted January 5, 2009 Share Posted January 5, 2009 your email server (aol.com) might be blocking it before it even gets to your mailbox to put into a spam folder. i've had issues with aol in the past. i'd try it on a different address. i didn't try your code, but going through it quickly it looks sound. so i'd check the issues with email itself. it could be because it's coming FROM some other url that where your site is... i believe that's part of the reason so many sites send from "do-not-reply@domain.com", and then you can just do a REPLY-TO piece in your header so that when you click the reply button it'd go there. Quote Link to comment Share on other sites More sharing options...
Mikedean Posted January 5, 2009 Share Posted January 5, 2009 Whenever setting the 'From' attribute I've always used the following. $headers .= "From: ".$name." <".$email.">\r\n"; Always seems to do the job for me, so I'd probably change that part or just remove it as Rhodesa suggested. Edit: I just tested your code and it did work to both my private email and Hotmail address. It was put in my junk email on my private email and worked fine with Hotmail, so it probably is just an issue with AOL. Quote Link to comment 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.