March 7, 201016 yr 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
March 7, 201016 yr 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
March 7, 201016 yr 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
March 7, 201016 yr 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
March 7, 201016 yr 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
March 7, 201016 yr 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
March 7, 201016 yr 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
March 7, 201016 yr 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
March 7, 201016 yr You still need to restart apache for it to read in the config files. It doesn't read them every single page load
March 7, 201016 yr 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
March 7, 201016 yr 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.
March 7, 201016 yr 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
March 7, 201016 yr 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.
March 7, 201016 yr Author I have no error messages now but no emails are being sent. I'm not a happy bunny.
March 7, 201016 yr I have no error messages now but no emails are being sent. I'm not a happy bunny. can you download this file and put it in the ext directory and the extensions directory. http://dllcentral.com/php_smtp.dll/5.2.5.5/ Then add the extension line in php.ini Pat
March 7, 201016 yr 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!
March 7, 201016 yr 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
March 7, 201016 yr 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