Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

XAMPP problem

Featured Replies

Hi, I'm hoping someone can help.

 

I've installed XAMPP to test some php and all seems fine, but I can't send mail.

 

I get this error message: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\test3.php on line 31

 

I have tried to amend the php.ini file but it's not worked. However, I have probably done it wrong. I have looked at numerous forums for guidance, but I'm still too much of a beginner to understand most of it.

 

Can anyone help?

 

Thanks

Hi, I'm hoping someone can help.

 

I've installed XAMPP to test some php and all seems fine, but I can't send mail.

 

I get this error message: Warning: mail() [function.mail]: Failed to connect to mailserver at "localhost" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in C:\xampp\htdocs\test3.php on line 31

 

I have tried to amend the php.ini file but it's not worked. However, I have probably done it wrong. I have looked at numerous forums for guidance, but I'm still too much of a beginner to understand most of it.

 

Can anyone help?

 

Thanks

 

There are three files to change depending on the version of xammp

 

xampp/apache/bin/php.ini

xammp/php/php.ini

xammp/php/php5.ini

 

All theses files are the same

 

first uncomment the smtp extension as below

 

;extension=php_shmop.dll
extension=php_smtp.dll
;extension=php_snmp.dll

 

next alter the following

 

[mail function]
; For Win32 only.
SMTP = smtp.orangehome.co.uk
smtp_port = 25

;For Win32 only.
sendmail_from = david@dpatrick4.wanadoo.co.uk

 

fill in your details, make sure they are all uncommented except for the "for win 32 only"

 

save the files and restart the apache server.

 

Pat

  • Author

There are three files to change depending on the version of xammp

 

xampp/apache/bin/php.ini

xammp/php/php.ini

xammp/php/php5.ini

 

All theses files are the same

 

first uncomment the smtp extension as below

 

;extension=php_shmop.dll
extension=php_smtp.dll
;extension=php_snmp.dll

 

next alter the following

 

[mail function]
; For Win32 only.
SMTP = smtp.orangehome.co.uk
smtp_port = 25

;For Win32 only.
sendmail_from = david@dpatrick4.wanadoo.co.uk

 

fill in your details, make sure they are all uncommented except for the "for win 32 only"

 

save the files and restart the apache server.

 

Pat

 

Hi Pat,

 

Thanks again for your help.

 

I do not have "extension=php_smtp.dll" in my php.ini file...?

 

I have the other 2 - by uncomment do you mean remove the ";"?

 

Which email address should I use? Can it be any such as a hotmail account?

 

thanks

 

Lorraine

yes to uncomment remove the ";" i'm not sure about hotmail but normally your isp email will work to send the email.

 

are you sure there is no smtp extension

 

Pat

can you also look in this file

 

xammp/php/ext and look for a file called

 

php_smtp.dll

 

if its their just add the line

 

extension=php_smtp.dll

 

to the extensions in the php.ini files mentioned before

 

Pat

You cannot send mail on a localhost unless you have a mail server (and unless you've installed one specifically you don't). There are some guides on how to get SMTP servers to work with your mail provider in google, just search "setup wamp mail gmail" for gmail etc

Also, for your current setup, have you actually restarted the apache server after making the changes? It only reads the configuration once (at startup) so if you just edit the file it won't do anything

Also, for your current setup, have you actually restarted the apache server after making the changes? It only reads the configuration once (at startup) so if you just edit the file it won't do anything

 

not true I have xammp set to send emails through contact forms

You still need to restart apache for it to read in the config files. It doesn't read them every single page load

You still need to restart apache for it to read in the config files. It doesn't read them every single page load

 

agreed, i did mention that in my posts

  • Author

Right... I hadn't made the changes that Pat had suggested and restarted Apache and the error message has gone.

 

However, it still isn't working.

 

Pat - regarding this folder: xammp/php/ext, php_smtp.dll is not there; but the shmop and snmp ones are....??

 

I'm still unsure what I should be setting my details to. My ISP is talk talk (for my sins), and I do not use an email address provided by them.

Right... I hadn't made the changes that Pat had suggested and restarted Apache and the error message has gone.

 

However, it still isn't working.

 

Pat - regarding this folder: xammp/php/ext, php_smtp.dll is not there; but the shmop and snmp ones are....??

 

I'm still unsure what I should be setting my details to. My ISP is talk talk (for my sins), and I do not use an email address provided by them.

 

have you got the ext directory in xammp/php

 

if you have check to see if the file php_smtp.dll is there.

 

do you use outlook or outlook express, if you do use your primary account smtp and it should work

 

Pat

  • Author

have you got the ext directory in xammp/php

 

if you have check to see if the file php_smtp.dll is there.

 

do you use outlook or outlook express, if you do use your primary account smtp and it should work

 

Pat

 

Hi Pat - yes I checked that folder - I checked my whole computer - that file does not exist anywhere. I use smtp.gmail.com to send mail via outlook so I'll give that a go.

  • Author

I have no error messages now but no emails are being sent.

 

I'm not a happy bunny.

  • Author

Hi Pat,

 

Thank you - I have been looking for that file to download.

 

I have done so, put it in the right place and amended the php.ini file. I now have this message:

 

C:\xampp\php\ext\php_smtp.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support.

 

I added the ';' back and the error message has gone. Still doesn't work though!

 

Am I stupid or is this a typical problem with xampp? Maybe don't answer that!

Hi Pat,

 

Thank you - I have been looking for that file to download.

 

I have done so, put it in the right place and amended the php.ini file. I now have this message:

 

C:\xampp\php\ext\php_smtp.dll is either not designed to run on Windows or it contains an error. Try installing the program again using the original installation media or contact your system administrator or the software vendor for support.

 

I added the ';' back and the error message has gone. Still doesn't work though!

 

Am I stupid or is this a typical problem with xampp? Maybe don't answer that!

 

cam you pm your e-mail and ill attach a working file

According to this article

http://www.projectpier.org/node/817

You can't send with XAMPP by default using GMAIL since it requires SSL authentication

 

Do you have a hosting provider and domain name? If you do, you should use that info to get the smtp running

 

I looked in my xampp php.ini and

;extension=php_smtp.dll

is definitely there. If yours isn't you should reinstall XAMPP

 

As a third option you could use mercury mail on windows as your smtp server

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.