It would make a lot more sense in your case to use a service configured and managed by someone else. While for a commercial website running your own MTA robably comes quite high on the list of things to do, it is not a trivial exercise - you really need to know what you're doing to get one configured and running securely. When I test basic scripts, they run just fine but when I try using POST to send data to variable from HTML input fields, nothing gets transferred to my PHP variables as noted when I try echoing them to a page. I am trying to test the PHP locally and have successfully set up WAMP. Your PHP is configured to talk to an SMTP server - the default for an MSWindows machine, but either you have no MTA installed or it's blocking connections. I am creating an online order form for a wholesale nursery. The page on configuring email explains that there's a big difference between the PHP mail command running on MSWindows and on every other operating system it's a good idea when posting a question to provide relevant information on how that part of your system is configured and what operating system it is running on. Usually a good place to start when you run into problems is the manual. $send = mail($to, $subject, $body, $headers) Įcho "Success. $headers = "Content-type: text/html charset=utf-8"
Just make sure to enter your own email address for the $to line.
Update: If this helps here's a script from my XAMP Control Panel:Ģ2::37:25 Initializing Control PanelĢ2::37:25 Windows Version: Windows 8 64-bitĢ2::37:25 Control Panel Version: 3.2.1 Ģ2::37:25 You are not running with administrator rights! This will work forĢ2::37:25 most application stuff but whenever you do something with servicesĢ2::37:25 there will be a security dialogue or things will break! So thinkĢ2::37:25 about running this application with administrator rights!Ģ2::37:25 XAMPP Installation Directory: "c:\xampp\"Ģ2::37:25 Checking for prerequisitesĢ2::37:25 Initializing module.Ģ2::37:25 Checking for module existence.Ģ2::37:25 Checking for required tools.Ģ2::37:25 Checking for service (name="Apache2.4"): Service not installedĢ2::37:25 Service Path: Service Not InstalledĢ2::37:25 Checking default ports.Ģ2::37:25 Checking for service (name="mysql"): Service not installedĢ2::37:25 Checking for service (name="FileZillaServer"): Service not installedĢ2::37:25 Checking for service (name="Tomcat7"): Service not installedĢ2::37:25 Enabling autostart for module "Apache"Ģ2::37:25 Enabling autostart for module "MySQL"Ģ2::37:26 Autostart active: starting.Ģ2::37:26 Checking default ports.Ģ2::37:26 Attempting to start Apache app.Ģ2::37:26 Executing "c:\xampp\apache\bin\httpd.exe"Ģ2::37:26 Attempting to start MySQL app.Ģ2::37:26 Executing ""c:\xampp\mysql\bin\mysqld.exe" -defaults-file="c:\xampp\mysql\bin\my.This will not work on a local host, but uploaded on a server, this code should do the trick. php file using localhost/contactform.php. When I input name, email address and a dummy message it works when I use action="" but not with 1, 2 and 3 above. The way I am testing is using Cntrl+O to open the Contact us.html in Chrome. Hi I am new to IIS7.I am not sure if this has been asked anywhere before but I need help to configure IIS7 to send out mails through php scripts.I have a website built in php and the links and the content's being displayed properly but when I submit the form the e-mail is not sent.I have modified the php.ini tried restarting the server after but nothing seems to help. The directory path is: c:\xampp\htdocs\contactform.php & c:\xampp\htdocs\Contact us.html I've tried all of these (based on suggestions in stackoverflow posts), none have worked: Note: This url used in action was obtained from an a website that guides email form design.īut I cannot code action correctly to get it to run using my local. When I use this action in the form tag it works (I get a "thanks for contacting us" confirmation): I am using xampp (apache) php and want to test my html email form locally.