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 can test send mail in Your PC without Internet
you should use Papercut this simple application to test send mail. and you don't need to configure anything.
Just run it and try test send mail:
test_sendmail.php
and you will see this:
I hope you will have a good day. you can find me on Youtube for more tutorial Piseth Sok
Cheer!
You can send mail from localhost with sendmail package , sendmail package is inbuild in XAMPP. So if you are using XAMPP then you can easily send mail from localhost.
for example you can configure
C:\xampp\php\php.ini
andc:\xampp\sendmail\sendmail.ini
for gmail to send mail.in
C:\xampp\php\php.ini
findextension=php_openssl.dll
and remove the semicolon from the beginning of that line to make SSL working for gmail for localhost.in php.ini file find
[mail function]
and changeNow Open
C:\xampp\sendmail\sendmail.ini
. Replace all the existing code in sendmail.ini with following codeNow you have done!! create php file with mail function and send mail from localhost.
PS: don't forgot to replace my-gmail-id and my-gmail-password in above code. Also, don't forget to remove duplicate keys if you copied settings from above. For example comment following line if there is another sendmail_path :
sendmail_path="C:\xampp\mailtodisk\mailtodisk.exe"
in the php.ini fileAlso remember to restart the server using the XAMMP control panel so the changes take effect.
For gmail please check https://support.google.com/accounts/answer/6010255 to allow access from less secure apps.
For people on windows 8 if you want to do this i would really recommend reading this tutorial i found: http://yogeshchaugule.com/blog/2013/configure-sendmail-wamp
Its not written by me but after slamming my head into a concrete wall for 2,5 hours not getting this to work with the weirdest errors like:
I finally found that tutorial were upon installation of https://www.stunnel.org/downloads.html and the configuration of Stunnel. It finally worked.