Jump to content

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 = me@example.com

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 me@example.com 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.

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • 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.