I am using a mail() function to send mail in PHP from localhost but it is not working.
Sending mail from localhost is my primary concern. Please guide me a way to achieve the same.
I am using a mail() function to send mail in PHP from localhost but it is not working.
Sending mail from localhost is my primary concern. Please guide me a way to achieve the same.
You won't have SMTP server installed by default so you can't send emails from localhost directly. Either you can set up SMTP server on local or use third party SMTP servers. Have a look at
http://www.mittalpatel.co.in/php_send_mail_from_localhost_using_gmail_smtp
which gives you insight about how to send mail from localhost using third party SMTP server.
Here's the some of the method that might be help you :
Method 1 https://stackoverflow.com/a/16814318/2377343
Method 2 http://thephpcode.blogspot.com/2009/03/setting-up-local-mail-smtp-pop3-imap.html
Method 3 http://blog.techwheels.net/send-email-from-localhost-wamp-server-using-sendmail/
Method 4 Configure wamp server to send email
Method 5 http://roshanbh.com.np/2007/12/sending-e-mail-from-localhost-in-php-in-windows-environment.html
It is configured to use localhost:25 for the mail server.
The error message says that it can't connect to localhost:25.
Therefore you have two options: