Send emails from localhost(WAMP Server)


If you are developing php project on localhost and you are using mail function on your project that time you may face problem with send mail function. so in this tutorial we are explain how to configure sendmail.

Follow the step below for configure sendmail:

Step 1: Download sendmail

Download sendmail and extract all the files in the folder “C:\sendmail\”

Step 2: Configure sendmail.ini

Open the file “C:\sendmail\sendmail.ini” and add the following params in the corresponding lines:

smtp_server=smtp.gmail.com
smtp_port=465
auth_username=your_address@gmail.com
auth_password=your_password
force_sender=your_address@gmail.com

Step 3 : Configure php.ini

Open the php.ini, find the following lines and add the path to the sendmail executable file. Don’t forget to restart the Apache server after doing that.

sendmail_path = "C:\sendmail\sendmail.exe -t"

Step 4: Test

Create a PHP script with the following code:(test.php)

mail('your_email@gmail.com','Test Mail Working','Mail received Successfully!!!!')

Run your test.php file and check your mail.

 

Advertisements

One comment

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s