justapilot Posted April 19, 2009 Share Posted April 19, 2009 I have a PHP mail script which I use to email data from forms for various websites. Always works fine, no problem, until now. Someone wanted to replace their ASP mail form with PHP so I did. I took both pages in question and put them up on my test server and they worked fine, however when uploaded to the clients server it doesnt work. He is running ASP AND PHP on his server, he just installed PHP yesterday to handle this form, and I dont have access to it, but im sure the problem is somewhere in the php.ini file. SO what happens when submit is clicked is the PHP page displays but under the thank you message it displays a hyperlink called function.mail that doesnt actually go anywhere. My PHP script is below: Any ideas? <?php $to = "[email protected]"; $subject = "Contact Us"; $email = $_POST['email'] ; $message=''; $fields=array('name', 'company', 'affiliations', 'mobile_phone', 'land_phone', 'email', 'emailverify', 'address', 'address2', 'city', 'state', 'zip', 'country'); foreach($_POST as $key => $var){ if(in_array($key, $fields)){ $message.=$key.': '.$var."\n"; } } $headers = "From: $email"; $sent = mail($to, $subject, $message, $headers) ; ?> Link to comment https://forums.phpfreaks.com/topic/154745-functionmail-help/ Share on other sites More sharing options...
jackpf Posted April 19, 2009 Share Posted April 19, 2009 Does this guy actually have an SMTP/POP3 server set up? And also, what's the full error? Link to comment https://forums.phpfreaks.com/topic/154745-functionmail-help/#findComment-813758 Share on other sites More sharing options...
soak Posted April 19, 2009 Share Posted April 19, 2009 If you view source you should see an error message that references a file and a line number. Can you post the message please? Link to comment https://forums.phpfreaks.com/topic/154745-functionmail-help/#findComment-813760 Share on other sites More sharing options...
FaT3oYCG Posted April 19, 2009 Share Posted April 19, 2009 its probably the smtp server settings in the php.ini file, but you dont have access so all you could do is ask for a copy so we can see what it looks like. Link to comment https://forums.phpfreaks.com/topic/154745-functionmail-help/#findComment-813781 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.