How to Change the SMTP Port in PHP
The PHP programming language has built-in e-mail functions that allow you to send e-mail messages. If your PHP server is running on the Windows platform, set the Simple Mail Transfer Protocol (SMTP) port for the e-mail functions to work. SMTP is an Internet standard used for e-mail exchange. The SMTP port is a logical data connection that allows the PHP software to communicate directly with the e-mail service. Specify this port manually to avoid PHP errors.
Instructions
-
-
1
Locate the PHP.ini file. It will be located within the directory where PHP is installed. If you have trouble finding this directory, click on "My Computer" to open the My Computer directory and press "Ctrl" and "F"' simultaneously. This will open a search dialogue. Enter "PHP.ini" and press enter. In a few moments, the PHP.ini file will show up in the search results page. Click on the file to open it for editing.
-
2
Locate the entry "smtp_port" in the PHP.ini file. This entry is about halfway down the document under the heading [mail function].
-
-
3
Enter the number "25" to the right of the "smtp_port" entry.
-
4
Save the file and exit. You have entered the SMTP port in PHP.ini.
-
1