Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
Dear friends
I try to run survey created by php scripts , but there is msg appeared when I click on send botton to receive survey result on my mail box ..
The msg is
"Warning: mail()[funcation.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:\Program Files\xampp\htdocs\test1\survey.php on line 198 "Also I want tell you that, my PC connect on the domain.
How can I fix this problem.
waiting your reply friends

Well, do you have a mail server running on localhost? Or is your domain mail server elsewhere?
If it is elsewhere you need to enter the correct smtp address in your config files for mailing to work (note: in that case, you also need your smtp mail server to be open for relay for your localhost IP).hth
Elinor Hurst
http://elinorhurst.blogspot.com

the PC in the domain and I want to use both domain mail server and hotmail
from where can I change smtp port in my PC ??
thx

Assuming you are using Windows, try changing your php.ini file to something like:
[mail function]
; For Win32 only.
SMTP = smtp.somewhereorother.com
smtp_port = 25; For Win32 only.
sendmail_from = someone@somewhereorother.comhth
Elinor Hurst
http://elinorhurst.blogspot.com

Hiya
I am having similar problems to 'malkaabi'.
I am new to PHP to this is a little confusing to say the least.
The error message is as follows:
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:\wamp\www\TestApplication\register.php on line 65
I have gone into the PHP.ini file and altered the SMTP statememnt to read:
SMTP = mail.btinternet.com
BT is the sevice provide that we use, so I presume that this is correct?
However, for the 'sendmail_from' statement I have altered to read:
sendmail_from = williamatkinson17@btinternet.com
This was an email address that the ISP (BT) issued me with.
The port is set at 25. I haven't altered this.
However, having run the script after having applied the amendments, it still is not rendering, and is stating the same error message as before.
Am I missing something?
Do I need to actually add some code to the scripts that I am writing??Please help.
Thanks
Will

Hi Will,
Are you sure you are changing the correct php.ini file? There are often 2 different php.ini files on the system, only one of which gets loaded.
If you are not sure, check your httpd.conf file.
The PHPIniDir setting determines which directory is used to search for the php.ini file. If present, it's usually located after the line:
LoadModule php5_module "path/to/php5/php5apache2_2.dll"If it isn't already declared, simply add the line as follows just after the LoadModule line:
PHPIniDir "path/to/phpinidir"
And restart the server.Hope this helps,
Elinor
Elinor Hurst
http://elinorhurst.blogspot.com

![]() |
![]() |
![]() |

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |