Jump to content

how to enable apache on my local machine send email?


ivytony

Recommended Posts

I'm developing and testing my PHP application on my personal laptop with internet connection. Sometimes, I need my application to send email, e.g. email for activation a user's registration. I wonder how to enable the Apache server on my local machine to send email to outside like gmail or hotmail.

 

thanks!

I'm developing and testing my PHP application on my personal laptop with internet connection. Sometimes, I need my application to send email, e.g. email for activation a user's registration. I wonder how to enable the Apache server on my local machine to send email to outside like gmail or hotmail.

 

thanks!

You don't need to install an SMTP mail server locally to send emails. Just configure PHP to point to an existing SMTP mail server. To do this open your php.ini and locate the following lines:

[mail function]
; For Win32 only.
SMTP = localhost
smtp_port = 25

; For Win32 only.
;sendmail_from = [email protected]

Change localhost to your ISP's mail server address, eg smtp.your_isp.com

Leave the smtp_port as-is (change it if your ISP uses a different port). Next remove the semi-colon ( ; ) from in front of the sendmail_from line and change [email protected] to the email address provided by your ISP.

 

Save the php.ini and restart Apache. Test to see if the changes worked by running a simple mail script.

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.