Enable Mail Function In XAMPP

How To Enable Mail Function In Xampp

XAMPP is the all in one package for developers. It contains the Apache web server and MySQL database. It can also interpret the scripts written in PHP and Perl languages. Xampp works on Mac, Linux, and Windows, through which you can build your own WordPress site offline just by using a local web server on your computer. If you like to enable mail function in XAMPP, you need to modify the sendmail.ini and php.ini files in the XAMPP folder.

Configure The php.ini File

  • Step 1: Go to My Computer, select Programs, and search for ‘php.’ You can find it inside the XAMPP installation folder.
  • Step 2: You need to change a single line in your php.ini file.
  • Step 3: Open the php.ini file. It will be indicated as ‘configuration settings’ in its type.
  • Step 4: Right-click the file and select Edit with notepad.
  • Step 5: When the file opens, press the Control and F keys simultaneously and search for the strings mentioned below and replace them with the values indicated.
  • Step 6: SMTP=smtp.gmail.com
  • Step 7: smtp_port=587
  • Step 8: sendmail_from = YourGmailId@gmail.com
  • Step 9: sendmail_path = "\"C:\xampp\sendmail\sendmail.exe\" -t"

Configure The Sendmail.ini File

  • Step 1: Go to My Computer, select Programs, and search for ‘sendmail.’
  • Step 2: Open the sendmail.ini file. It will be indicated as ‘configuration settings’ in its type. Right-click the file and select Edit with notepad.
  • Step 3: When the file opens, press the Control and F keys simultaneously and search for the strings mentioned below and replace them with the values indicated.
  • Step 4: smtp_server=smtp.gmail.com
  • Step 5: smtp_port=587
  • Step 6: error_logfile=error.log
  • Step 7: debug_logfile=debug.log
  • Step 8: auth_username=YourGmailId@gmail.com
  • Step 9: auth_password=Your-Gmail-Password

Format For Sending The Mail

  • Step 1: For checking the functionality, create a php file and open it.
  • Step 2: The format for sending a file should be similar to the following one. But you need to replace the required field with the exact subject, and it’s just a format alone.

?php mail(‘recipient mail id’,‘sample mail’,‘sample content’,‘From: sender mail’);

You need to replace recipient mail id with the email address of the one you need to send the mail. You need to replace the sample mail field with the subject of your mail. The sample content field is for the text of your mail. You need to replace it with your message. Replace the sender mail field with the email address from which you need to send the mail.

Open the XAMPP control panel and press Start under Actions for Apache. Now open a browser and enter https://localhost/example/phpmailer.php. Once you press enter, your email will be sent. You can recheck by opening the recipient’s email address.

Hope these steps were helpful to enable mail function in XAMPP.

Related Searches

How To Encrypt Email?

How To Encrypt Email?

In order to prevent third parties from reading your mail content, email encryption is done, which is basically digitizing the information within. 

How To Stop Spam Emails?

How To Stop Spam Emails?

There are not many ways to prevent spam from piling up in your Inbox. Here’s how you can filter out most of them.

Fix AT&T Email Error

Fix AT&T Email Error 0x800CCC0F

AT&T Email error 0x800CCC0F occurs when mails are not being sent or received through AT&T services. Due to the technical glitches causing it, many email functions are disabled. The computer’s Operating System might get frozen.

How To Delete All Emails In Gmail?

How To Delete All Emails In Gmail?

Open the Gmail app.Select the inbox tab you want to delete.You’ll find the Empty Box button over the Compose button.

How To Change Email Address?

How To Change Email Address?

Log into the email website.Click the account name and go to your profile.Head to Settings Security & Privacy Change password.