rondog Posted August 10, 2007 Share Posted August 10, 2007 I am positive this has something to do with the server it is on because when I test it on my server the script works. My php looks like this: <?php $submit = $_POST['submit']; $name = $_POST['namebox']; $email = $_POST['emailbox']; $comment = $_POST['commentbox']; if($submit) { $confirm = "Thank you $name for your interest in Integrated Tool Solutions. We will contact you shortly."; $content = "Name: $name\n"; $content .= "Email: $email\n"; $content .= "Comments:\n$comment"; $result1 = mail("$email","Thanks for your interest $name",$confirm); $result2 = mail("ronnieatdopdotcom","ITS Inquiry from $name",$content); if ($result1 && $result2) { echo "&msgText=Message Sent"; } else { echo "&msgText=Message failed"; } } ?> So on their server im getting message failed whereas on my server it goes through just fine. I have access to their php ini file so if it something in their that I have to change what would it be? The server is running IIS on windows2k if that helps. Thanks. -Ronnie Quote Link to comment https://forums.phpfreaks.com/topic/64298-mail-function-not-working/ Share on other sites More sharing options...
rondog Posted August 10, 2007 Author Share Posted August 10, 2007 reading some of these posts it seems the problem might be that the server doesn't have an smtp server? How would I set one up? I have total access to this server as I am on it through remote desktop. The ini file looks like this so far [mail function] ; For Win32 only. SMTP = localhost smtp_port = 25 ; For Win32 only. ;sendmail_from = me@example.com ; For Unix only. You may supply arguments as well (default: "sendmail -t -i"). ;sendmail_path = ; Force the addition of the specified parameters to be passed as extra parameters ; to the sendmail binary. These parameters will always replace the value of ; the 5th parameter to mail(), even in safe mode. ;mail.force_extra_parameters = Quote Link to comment https://forums.phpfreaks.com/topic/64298-mail-function-not-working/#findComment-320559 Share on other sites More sharing options...
rondog Posted August 10, 2007 Author Share Posted August 10, 2007 any ideas? I installed some free smtp server called qk smtp but I couldnt get it to work. Quote Link to comment https://forums.phpfreaks.com/topic/64298-mail-function-not-working/#findComment-320631 Share on other sites More sharing options...
d22552000 Posted August 10, 2007 Share Posted August 10, 2007 I host my own site from my comptuer, but have never goten an smpt server to work (i think y isp blocks it) In any case, you might want to use an external SMPT server for now.. try this: Useraname: ???@gmail.com password: ???? smtp server: mail.gmail.com smtp port; 25 im not sure whree you put the username and password stuff, but it would be in the mail call php file. Quote Link to comment https://forums.phpfreaks.com/topic/64298-mail-function-not-working/#findComment-320647 Share on other sites More sharing options...
rondog Posted August 10, 2007 Author Share Posted August 10, 2007 yeah I dont know that doesnt really help me..thanks though Quote Link to comment https://forums.phpfreaks.com/topic/64298-mail-function-not-working/#findComment-320686 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.