0

I am using the contact form for sending the mails on my system but am getting this errors:

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 D:\xampp\htdocs\sample-emailer\samplemail.php on line 32

Error sending email!

My php.ini

[mail function]
; For Win32 only.
; http://php.net/smtp
SMTP=localhost
; http://php.net/smtp-port
smtp_port=25

; For Win32 only.
; http://php.net/sendmail-from
;sendmail_from =you@yoursite.com

How to solve this?

Udhav Sarvaiya
  • 9,380
  • 13
  • 53
  • 64
Sam
  • 1,381
  • 4
  • 30
  • 70
  • You have to have SMTP configured to use it in your mail() function. Take a look at this answer for more details on configuration: https://stackoverflow.com/a/55008494/1141944 – tshimkus Mar 15 '19 at 05:26
  • Hope this will help you https://stackoverflow.com/questions/4532486/failed-to-connect-to-mailserver-at-localhost-port-25 – Udhav Sarvaiya Mar 15 '19 at 05:53
  • @Udhav Sarvaiya am using windows8 how to enable the smtp server – Sam Mar 15 '19 at 05:56

0 Answers0