The PHP.INI file in Apache server configures settings for websites that use the PHP language. When you send email from the PHP code, the server uses the settings in the main PHP.INI file. You set up the outgoing server in the PHP.INI file, and the server settings route the message to the outgoing mail server. You can use the Gmail server as an outgoing server, provided you have a Google Gmail account.
Click the Windows "Start" button and type "php.ini" and press "Enter." The location of the PHP.INI file displays. Right-click the file, click "Open With," then click "Notepad" to open the file in an editor.
Add the server information. The default SMTP port is 25, but you can specify an alternate email port for high traffic websites. The following code shows you how to set up the SMTP server:
smtp_server=smtp.gmail.com
smtp_port=25
Set up the Gmail login information. The login information is your Gmail account and the password for the Gmail address. The PHP.INI file is secured on the server, so users cannot see the outgoing password. The following code shows you how to set up the login information:
auth_username=myemail@gmail.com
auth_password=mypass
Replace the two values with your own Gmail account user name and password.
Press the "Ctrl" and "S" keys to save the changes. Press the Windows "Start" button again and type "cmd." Press "Enter." Type "apache restart" to restart the Apache service.
Click the Windows "Start" button and type "php.ini" and press "Enter." The location of the PHP.INI file displays. Right-click the file, click "Open With," then click "Notepad" to open the file in an editor.
Add the server information. The default SMTP port is 25, but you can specify an alternate email port for high traffic websites. The following code shows you how to set up the SMTP server:
smtp_server=smtp.gmail.com
smtp_port=25
Set up the Gmail login information. The login information is your Gmail account and the password for the Gmail address. The PHP.INI file is secured on the server, so users cannot see the outgoing password. The following code shows you how to set up the login information:
auth_username=myemail@gmail.com
auth_password=mypass
Replace the two values with your own Gmail account user name and password.
Press the "Ctrl" and "S" keys to save the changes. Press the Windows "Start" button again and type "cmd." Press "Enter." Type "apache restart" to restart the Apache service.


03:58
Faizan
Posted in: