I am trying to send mail from localhost. but i am unable to send the mail from localhost so can anybody tell me that how to reconfigure my xampp to send mail from localhost
相关问题
- Views base64 encoded blob in HTML with PHP
- Laravel Option Select - Default Issue
- PHP Recursively File Folder Scan Sorted by Modific
- Can php detect if javascript is on or not?
- Using similar_text and strpos together
You have to define an
SMTP
server and a port for this. All except like sending mails from live hosts.This is a useful link regarding this.
If you have an installed copy of xampp latest copy then check this link for complete documentation of sending emails through xampp. You must enable apache before you try to access the below link
http://localhost/dashboard/docs/send-mail.html
In XAMPP v3.2.1 for testing purposes you can see the emails that the XAMPP sends in XAMPP/mailoutput. In my case on Windows 8 this did not require any additional configuration and was a simple solution to testing email
just spent over an hour trying to make this work. for everybody having the same trouble with all the suggestions posted not working: you have to restart Apache in your XAMPP inrerface! just restarting XAMPP wont work!!
You have to configure SMTP on your server. You can use G Suite SMTP by Google for free:
Read more about
PHPMailer
here.Its very simple to send emails on localhost or local server
Note: I am using the test mail server software on Windows 7 64bit with Xampp installed
Just download test mail server tool and install according to the instruction given on its website Test Mail Server Tool
Now you need to change only two lines under
php.ini
file[mail function]
and remove semi colon which is before;smtp = localhost
sendmail_path = "C:\xampp\mailtodisk\mailtodisk.exe"
You don't need to change anything else, but if you still not getting emails than check for the
SMTP port
, the port number must be same.The above method is for default settings provided by the Xampp software.