0

So I'm trying to send a mail from my contactform to my mailadress. My problem is that when i press the mail it doesn't work.

This is the error message i get:

Warning: mail(): Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\Projekt_1\php\send_form_email.php on line 12

As my minor programming and hosting skills tells me i need to change something in my php.ini file but I'm not sure how or what i need to do.

RiggsFolly
  • 93,638
  • 21
  • 103
  • 149
  • Make sure you are following the correct way. refer https://stackoverflow.com/questions/5335273/how-to-send-an-email-using-php – manu Jan 27 '20 at 11:49
  • 1
    Did you install a mailserver? – B001ᛦ Jan 27 '20 at 11:56
  • "i need to change something in my php.ini file"....no, you need to install and configure a mailserver on your machine. Or, probably more easy, switch to using something like PHPMailer instead of mail() and connect to a 3rd party SMTP server. – ADyson Jan 27 '20 at 12:02
  • 1
    1) Windows does not come with a MailServer pre installed. 2) The PHP `mail()` function does not send email, it just passes it to a mail server for transmittion. So if you have no mail server it wont send mail – RiggsFolly Jan 27 '20 at 12:02
  • 1
    **Good News** XAMPP comes with a utility called `sendmail.exe` See the Dup Q&A and it will tell you how to configure it or better still see @ADyson comment and use `PHPMailer` – RiggsFolly Jan 27 '20 at 12:04

0 Answers0