Active5 months ago

I am trying to send mail from localhost.but i am unable to send the mail from localhostso can anybody tell me that how to reconfigure my xampp to send mail from localhost

Raptor
36.8k33 gold badges184 silver badges309 bronze badges

What is MAMP PRO? MAMP PRO is the commercial, professional frontend for the classic local server environment: MAMP. With MAMP PRO you can create a separate host for each of your web projects. Install WordPress with only one click and after completion of your page, publish it directly from MAMP PRO on your live server.This. To install PHPMailer, you upload a few files to a folder on your web server (or in the document root, which in XAMPP is the htdocs folder). These files are important: class.phpmailer.php --> Necessary.

farid shaikhfarid shaikh
1,1453 gold badges8 silver badges3 bronze badges

11 Answers

You can send mail from localhost with sendmail package , sendmail package is inbuild in XAMPP.So if you are using XAMPP then you can easily send mail from localhost.

for example you can configure C:xamppphpphp.ini and c:xamppsendmailsendmail.ini for gmail to send mail.

in C:xamppphpphp.ini find extension=php_openssl.dll and remove the semicolon from the beginning of that line to make SSL working for gmail for localhost.

in php.ini file find [mail function] and change

Now Open C:xamppsendmailsendmail.ini. Replace all the existing code in sendmail.ini with following code

Now you have done!! create php file with mail function and send mail from localhost.

PS: don't forgot to replace my-gmail-id and my-gmail-password in above code.Also, don't forget to remove duplicate keys if you copied settings from above. For example comment following line if there is another sendmail_path : sendmail_path='C:xamppmailtodiskmailtodisk.exe' in the php.ini file

Also remember to restart the server using the XAMMP control panel so the changes take effect.

For gmail please check https://support.google.com/accounts/answer/6010255 to allow access from less secure apps.

To send email on Linux (with sendmail package) through Gmail from localhost please check PHP+Ubuntu Send email using gmail form localhost.

Vikas DwivediVikas Dwivedi
3,8891 gold badge14 silver badges13 bronze badges

In XAMPP v3.2.1 for testing purposes you can see the emails that the XAMPP sends in XAMPP/mailoutput. In my case on Windows 8 this did not require any additional configuration and was a simple solution to testing email

Paul TrotterPaul Trotter

Its very simple to send emails on localhost or local server

Note: I am using the test mail server software on Windows 7 64bit with Xampp installed

Just download test mail server tool and install according to the instruction given on its website Test Mail Server Tool

Now you need to change only two lines under php.ini file

  1. Find [mail function] and remove semi colon which is before ;smtp = localhost
  2. Put the semi colon before sendmail_path = 'C:xamppmailtodiskmailtodisk.exe'

You don't need to change anything else, but if you still not getting emails than check for the SMTP port, the port number must be same.

The above method is for default settings provided by the Xampp software.

Vikas KhuntetaVikas Khunteta

You have to configure SMTP on your server. You can use G Suite SMTP by Google for free:

Read more about PHPMailerhere.

Hristiyan Dodov
2,0901 gold badge16 silver badges31 bronze badges
Thirumalai muruganThirumalai murugan
3,6786 gold badges26 silver badges51 bronze badges

You can test send mail in Your PC without Internet

you should use Papercut this simple application to test send mail. and you don't need to configure anything.

Just run it and try test send mail:

test_sendmail.php

and you will see this:

I hope you will have a good day.you can find me on Youtube for more tutorial Piseth Sok

Cheer!

Piseth SokPiseth Sok
1,1281 gold badge12 silver badges18 bronze badges

For people on windows 8 if you want to do this i would really recommend reading this tutorial i found: http://yogeshchaugule.com/blog/2013/configure-sendmail-wamp

Its not written by me but after slamming my head into a concrete wall for 2,5 hours not getting this to work with the weirdest errors like:

  • Connection timed out.
  • Connection Closed Gracefully.

I finally found that tutorial were upon installation of https://www.stunnel.org/downloads.html and the configuration of Stunnel. It finally worked.

How to install php mailer on wordpressN.SchipperN.Schipper
1,0433 gold badges14 silver badges23 bronze badges

As in my personal experience I found that very similar thing to Vikas Dwivedi answer will work just fine.

Step 1 (php.ini file)

In php.ini file located in xamppphpphp.ini. Change settings to the following:

Turn off other variables under mail funciton by putting ; before them. e.g ;smtp_port=25

Step 2 (sendmail.ini file)

In sendmail.ini located in xamppsendmailsemdmail.ini change to the following:

Step 3 (code)

Create a php file and use the following:

Notice

  • You need to restart apache in order for php.ini to reload.
  • you need to activate Google Less secure app access in https://myaccount.google.com/u/1/security
  • It might help to run Xampp with Admin permission.
Udhav Sarvaiya
3,19110 gold badges21 silver badges33 bronze badges
Mahdi RafatjahMahdi Rafatjah
6021 gold badge4 silver badges18 bronze badges

If you have an installed copy of xampp latest copy then check this link for complete documentation of sending emails through xampp. You must enable apache before you try to access the below link

Jignesh RawalJignesh Rawal

This code is used for the mail from your localhost XAMPP and your Gmail account.This code is very easy and working for me try your self.

Below Change In php.ini File

Below Change In sendmail.ini File

Please write the belove code in your PHP file to send email

Udhav Sarvaiya
3,19110 gold badges21 silver badges33 bronze badges
Kishan SorathiyaKishan Sorathiya

You have to define an SMTP server and a port for this. All except like sending mails from live hosts.

This is a useful link regarding this.

NB: The port should be unused. Please take care that, Some applications like Skype uses the default ports and there by prevents sending mail.

Vishnu RenkuVishnu Renku
1,5662 gold badges20 silver badges42 bronze badges

just spent over an hour trying to make this work. for everybody having the same trouble with all the suggestions posted not working: you have to restart Apache in your XAMPP inrerface! just restarting XAMPP wont work!!

user3065579user3065579

protected by CommunityJan 11 '15 at 9:06

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

Not the answer you're looking for? Browse other questions tagged phpxampp or ask your own question.

Active5 months ago

I'm trying to install Laconica, an open-source Microblogging application on my Windows development server using XAMPP as per the instructions provided.

The website cannot find PEAR, and throws the below errors:

Warning: require_once(PEAR.php) [function.require-once]: failed to open stream: No such file or directory in C:xampplitehtdocslaconicalibcommon.php on line 31

Fatal error: require_once() [function.require]: Failed opening required 'PEAR.php' (include_path='.;xampplitephppearPEAR') in C:xampplitehtdocslaconicalibcommon.php on line 31

  1. PEAR is located in C:xampplitephppear
  2. phpinfo() shows me that the include path is .;xampplitephppear

What am I doing wrong? Why isn't the PEAR folder being included?

Gottlieb Notschnabel
5,23216 gold badges57 silver badges99 bronze badges
Donnie ThomasDonnie Thomas
1,7648 gold badges38 silver badges65 bronze badges

8 Answers

You need to fix your include_path system variable to point to the correct location.

To fix it edit the php.ini file. In that file you will find a line that says, 'include_path = ..'. (You can find out what the location of php.ini by running phpinfo() on a page.) Fix the part of the line that says, 'xampplitephppearPEAR' to read 'C:xampplitephppear'. Make sure to leave the semi-colons before and/or after the line in place.

Restart PHP and you should be good to go. To restart PHP in IIS you can restart the application pool assigned to your site or, better yet, restart IIS all together.

cweiske
24k11 gold badges97 silver badges160 bronze badges
user7075user7075

If you are using the portable XAMPP installation and Windows 7, and, like me have the version after they removed the XAMPP shell from the control panel none of the suggested answers here will do you much good as the packages will not install.

The problem is with the config file. I found the correct settings after a lot of trial and error.

Simply pull up a command window in the xamppphp directory and run

you will want to replace the ':' with the actual drive letter that your portable drive is running on at the moment. Unfortunately, this needs to be done any time this drive letter changes, but it did get the module I needed installed.

Reid JohnsonReid Johnson

Introduction to public policy wheelan pdf printer. I tried all of the other answers first but none of them seemed to work so I set the pear path statically in the pear config file

C:xamppphppearConfig.php

find this code:

and just replace it with this:

I restarted apache and used the command:

make sure the all of the paths no longer start with C:phppear

Alex RapsoAlex Rapso

How To Install Php Mailer On Wordpress

AS per point 1, your PEAR path is c:xampplitephppear

However, your path is pointing to xampplitephppearPEAR

Putting the two one above the other you can clearly see one is too long:

c:xampplitephppear

xampplitephppearPEAR

Your include path is set to go one PEAR too deep into the pear tree. The PEAR subfolder of the pear folder includes the PEAR component. You need to adjust your include path up one level.

(you don't need the c: by the way, your path is fine as is, just too deep)

THEMikeTHEMike
7571 gold badge10 silver badges23 bronze badges

How To Use Xampp

Try adding the drive letter:

also verify that PEAR.php is actually there, it might be in php instead:

user212218
SietseSietse
5,18010 gold badges45 silver badges62 bronze badges

Another gotcha for this kind of problem: avoid running pear within a Unix shell (e.g., Git Bash or Cygwin) on a Windows machine. I had the same problem and the path fix suggested above didn't help. Switched over to a Windows shell, and the pear command works as expected.

bluestragglerbluestraggler

On Windows use the Xampp shell (there is a 'Shell' button in your XAMPP control panel)

then

to go to 'C:xamppphppear'

then type

Tutorialmpalenciampalencia
2,6442 gold badges25 silver badges39 bronze badges

I fixed

avast deletes your server.php in your directoryso disable the antivirus

check the (server.php) file on your laravel folder

server.php

Musab ibnu SirajMusab ibnu Siraj

protected by CommunitySep 6 '17 at 18:34

Thank you for your interest in this question. Because it has attracted low-quality or spam answers that had to be removed, posting an answer now requires 10 reputation on this site (the association bonus does not count).
Would you like to answer one of these unanswered questions instead?

How To Configure Xampp Server

Not the answer you're looking for? Browse other questions tagged phppearlaconica or ask your own question.