php – how can i install free local mailserver on windows?

php – how can i install free local mailserver on windows?

  1. php version – 7.4.16

  2. xampp version – 3.2.4

  3. Windows 7 64-bit


Configure php.ini file –

file path – C:xamppphpphp.ini

in php.ini file find [mail function] and do below changes –

SMTP=smtp.gmail.com
smtp_port=587
sendmail_from = my-gmail-id@gmail.com
sendmail_path = C:xamppsendmailsendmail.exe -t

Configure sendmail.ini file –

file path – C:xamppsendmailsendmail.ini

Note : if you dont have sendmail file/folder, please follow download and setup process below.

in sendmail.ini file do below changes –

[sendmail]

smtp_server=smtp.gmail.com
smtp_port=587
error_logfile=error.log
debug_logfile=debug.log
auth_username=my-gmail-id@gmail.com
auth_password=my-gmail-password
force_sender=my-gmail-id@gmail.com

Now Restart the server (Apache) using the XAMMP so the changes take
effect.

Note : If ; (semi colon) exists at the starting of mentioned lines, Remove them


Configure Google Account

Turn on Less secure app access from google account security tab.

e.g. –

Less-secure-app-access

Ref url – https://support.google.com/accounts/answer/6010255


Steps to download and setup sendmail package –

Step 1 – Download zip file from https://www.glob.com.au/sendmail/

Step 2 – Extract all files within sendmail folder and paste it on xampp folder.

e.g. –

sendmail-path


Now all set!! create php file with mail function and send mail from localhost.

This whole method of sending mail is perfectly working in my localhost.

SMTP-mail

php – how can i install free local mailserver on windows?

Leave a Reply

Your email address will not be published.