I'm new to PHP can someone help out with this error message?

Need help installing PHP, configuring a script, or configuring a server? Then come on in and post your questions! We'll try to help the best we can!

Moderator: General Moderators

yaqub
Forum Newbie
Posts: 8
Joined: Thu Aug 03, 2006 4:52 pm

I'm new to PHP can someone help out with this error message?

Post by yaqub »

Hi all-

I'm new tp PHP and trying to make mail form. Can someone please let me know step by step how to re-config the php.ini when 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:\Program Files\Apache Group\Apache2\htdocs\newland\message_sent.php on line 6


I have downloaded QK SMTP Server but I don't know how to change the php.ini file or how to find the file on my system.

Please like I said give me a step by step instruction for how to reconfig that file.

I really appreciate any help given.
User avatar
feyd
Neighborhood Spidermoddy
Posts: 31559
Joined: Mon Mar 29, 2004 3:24 pm
Location: Bothell, Washington, USA

Post by feyd »

It may be easier to use a library such as Swiftmailer, or phpmailer. Both are a simple search away.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

I agree with feyd.

But anyway:
Is this smtp server up and running?
Try http://www.qksoft.com/qk-smtp-server/online-help.html
yaqub
Forum Newbie
Posts: 8
Joined: Thu Aug 03, 2006 4:52 pm

Yeah the server is up and running

Post by yaqub »

Yes it's up and running, but I need to specify in the php.ini file to use that server. I saw another post on another board saying that same thing, but they didn't say how to let the php.ini file know what server to use.

Can someone walk me through that?????

Thanks
User avatar
daedalus__
DevNet Resident
Posts: 1925
Joined: Thu Feb 09, 2006 4:52 pm

Post by daedalus__ »

If you find the php.ini file I'm sure you could figure it out yourself.

If it's a Windows box you might try the windows or system directory, also, there is one in the PHP directory.
yaqub
Forum Newbie
Posts: 8
Joined: Thu Aug 03, 2006 4:52 pm

Gee how nice of people's help

Post by yaqub »

"If you find it I'm sure you figure it out yourself"???????????????????

What a revelation that was. And what a help that was. If I could figure it out I wouldn't bother asking for some help, what part of that didn't you understand??

Thanks for nothing
User avatar
Luke
The Ninja Space Mod
Posts: 6424
Joined: Fri Aug 05, 2005 1:53 pm
Location: Paradise, CA

Post by Luke »

:lol: Not going to get much help with that attitude.
yaqub
Forum Newbie
Posts: 8
Joined: Thu Aug 03, 2006 4:52 pm

Thanks to the first 2 replies

Post by yaqub »

Thanks to the first 2 guys who replied. That's not what I was looking for. As for the second 2 did either of you really think that was helping me out????? If you did then I'm sorry it didn't help me out. Just by saying if you can find the file you could probably figure it out ain't help at all.

Not sure if you were just born with the knowledge of PHP or gee maybe you learned it and wow maybe someone along the way helped you out. That's what I was hoping for, but if all I get is what I've gotten so far well then......................

Once again this was directed at the 2 posts who really didn't even seem like they even bothered to offer assistance. The latter of the 2 should offer help or not post. Smart comments ain't gonna help me figure out why I can't send my mail. But thanks
yaqub
Forum Newbie
Posts: 8
Joined: Thu Aug 03, 2006 4:52 pm

So to get back to the subject____________

Post by yaqub »

I don't know how to configure the php.ini file. Can someone walk me through it step by step please.


Thanks in advance to those who want to help.
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

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:\Program Files\Apache Group\Apache2\htdocs\newland\message_sent.php on line 6
right now php expects the smtp server to run on the same machine, port 25. When I installed QK Server port 25 was the default setting (as expected).
On what server is php installed and on what server is QK running?
yaqub
Forum Newbie
Posts: 8
Joined: Thu Aug 03, 2006 4:52 pm

I'm using............

Post by yaqub »

Hi thanks for the reply and really offering to help man I really appreciate it.

Now............... I'm running Apache and that's what PHP is running on. As for anything else I have QK SMTP running and it's on the same machine I'm just running this trial mail form on my machine until I upload it to the host server. So this is very important to understand as once I upload the form I'm sure I will have to re-re-configure this again to reflect that server.

Can you please tell me like go to this spot on your computer(as Apache basically installs to the same spot if just default is selected) so I can find the php.ini file and then tell what general area to look at in the file as well what to change.

Thanks
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

Code: Select all

<?php phpinfo(); ?>
tells you which php.ini is used. Changes on that file probably require a restart of the apache.

But
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:\Program Files\Apache Group\Apache2\htdocs\newland\message_sent.php on line 6
it's already configured to contact a smtp server at the same machine on port 25.
yaqub
Forum Newbie
Posts: 8
Joined: Thu Aug 03, 2006 4:52 pm

How do I get to that file and change the setting to reflect

Post by yaqub »

How do I get to that file and change the settings to reflect that I'm specifing QK SMTP Mail Server? By the way should I just use one of the other mail servers that were mentioned earlier in the post?

Thanks
User avatar
volka
DevNet Evangelist
Posts: 8391
Joined: Tue May 07, 2002 9:48 am
Location: Berlin, ger

Post by volka »

There is no setting to indicate a special server.
For php/win32 it's just a socket it can connect to and use smtp commands to send an email - regardless of the smtp server program.
yaqub
Forum Newbie
Posts: 8
Joined: Thu Aug 03, 2006 4:52 pm

Ok then what am I doing wrong?

Post by yaqub »

What am I doing wrong then? The error message says that it can't find a server doesn't it? I think it says that.
Post Reply