PHP Build a Basic PHP Website (2018) Adding a Basic Form Utilizing Object Properties and Methods

Please help

when i hit Send it shows me an error message in browser : Message could not be sent.Mailer Error: Could not instantiate mail function.

can anyone tell where is problem? :)

Dane Parchment
Dane Parchment
Treehouse Moderator 10,306 Points

Can you please provide the code that is causing the issue, it will make it easier for us to debug the issue for you, as their could be many reasons for this happening.

Eric Drake
Eric Drake
6,339 Points

What kind of development environment are you using? Are you using XAMP or your own Windows or Linux server?

Obayanju Damilare
Obayanju Damilare
3,383 Points

Hi, I got the same error and I use a XAMP server. Please what's the solution

1 Answer

Matt Corby
Matt Corby
2,385 Points

I was having the same issue. I'm using an XAMPP server.

I used the solution provided here: http://stackoverflow.com/questions/15965376/how-to-configure-xampp-to-send-mail-from-localhost

You have to change some settings in you php.ini and sendmail.ini files!