PHP failed to connect to mailserver at localhost port 25 xampp October 24, 2018 Pramod T P Leave a comment In your php.ini file you can configure which mailserver to use: [mail function] SMTP = mymailserver.example.com