Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations gkittelson on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

HTML Forms Processing Using PHP on Windows Server

Status
Not open for further replies.

WilliamMute

Programmer
Jan 4, 2006
117
Hi,

I have an html form which I need to process and send in an email basically. I usually use Linux Server which works fine with the code below

Code:
<p>Thank you <strong><?php echo($name);?> </strong> 
        <?php
	
	/* This section tries to send the form, if successful a successful message is displayed if not, an error message is diplayed. the r\n write the next variable on a new line*/

	$formsent = mail("me@mydomain.co.uk", 
	"Web Message: $name\r\n", "$name Said: $comment\r\n Phone or Email $phone\r\n"); 
	if ($formsent == 1)
		{
		echo("<P>We have sucessfully received your form. We will be in contact you as soon as possible."); 
		}
	 else
	 	print("I'm sorry, there's a problem with your form.  Please try again.");
	?>

That was the simple code that does it for me on Linux Server.

How can I do the same on windows server as the code below does nothing on a windows server.

Thank you for your help.
 
mail() works differently on windows. you need access to an smtp server and to make sure that the right values are in php.ini.
 
Thanks Justin. I found this code on my Hosting company's website

Code:
ini_set("sendmail_from", "info@seeme.co.uk");

How can I integrate this into my existing code?
 
Never mind. Thanks for your help. I've got it working now.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top