Today, communicating through mail in web apps is common, but there are some hurdles that might appear challenging if you are doing it for the first time.
This shot shows you how to configure XAMPP to enable the use of the PHP mail function to send emails. This configuration will allow the built-in XAMPP
sendmail.exe binary to deliver emails.
xamppdirectory and locate the
phpfolder. Inside this folder, locate the
php.iniconfiguration file. Your path should look like this:
[mail function]part, and replace the code there with the following:
sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"
This command points to the
sendmail folder, which we will now edit.
Go to your XAMPP directory once more and find the
Open up the
sendmail.ini file inside and find the
Replace the code in this portion with the following code, exchanging the example values with your own information:
smtp_server=smtp.gmail.com smtp_port=465 smtp_ssl=auto error_logfile=error.log firstname.lastname@example.org auth_password=your-gmail-account-password
If you are not using the Gmail SMTP server, please make sure to change it to your preferred server.
Now, with all these changes made and saved, restart your Apache server and you will be able to send emails from your application with the PHP
A simple tip: locating the necessary section in these files can be tedious, so use the find word ability of your editor to get to those sections.
View all Courses