Show How to Send Mail from Localhost XAMPP Using Gmail Featured In - Magento 1, Sanjay Jethva XAMPP is Cross-Platform (X), Apache (A), MariaDB (M), PHP (P) and Perl (P). It is for developers to create a local webserver for testing or deployment purposes. As a part of testing, developers need to send emails that are always going to be there when it comes to online businesses. To send mail from localhost XAMPP using Gmail, configure XAMPP after installing it. Follow the below steps for the same. Steps to Send Mail From Localhost XAMPP Using Gmail:
Script To Send Mail:1 2 3 4 5 6 7 8 9 10 11 <?php $to_email = "[email protected]"; $subject = "Simple Email Test via PHP"; $body = "Hi,nn This is test email send by PHP Script"; $headers = "From: sender\'s email";
if (mail($to_email, $subject, $body, $headers)) { echo "Email successfully sent to $to_email..."; } else { echo "Email sending failed..."; } Hope this guide will be helpful!Note: Please configure “Less secure apps” settings as shown at https://support.google.com/cloudidentity/answer/6260879 for proper working. Also, if you are still facing issues, the reason can be one of the below:
Any doubts on the topic? Please mention them in the Comments section below and I’d be glad to help you out. Feel free to share the solution via social media. Thanks! 4.9 (based on 118 Reviews) Sanjay Jethva Sanjay is a co-founder at Meetanshi. He is a Certified Magento Developer who loves creating Magento E-commerce solutions. Owing to his contributions in Magento Forums and posting solutions, he is among the top 50 contributors of the Magento community in 2019. When he is not engrossed with anything related to Magento, he loves to play cricket. Our Popular Magento 2 Extensions & Services 109 Comments
|