Errors, php.ini, SMTP questions

PHP programming forum. Ask questions or help people concerning PHP code. Don't understand a function? Need help implementing a class? Don't understand a class? Here is where to ask. Remember to do your homework!

Moderator: General Moderators

Post Reply
toni
Forum Newbie
Posts: 11
Joined: Fri Jan 09, 2004 8:30 pm

Errors, php.ini, SMTP questions

Post by toni »

Hello,

I have put together a simple 404 error page that e-mails the site that was requested and the page referrer. The page works great on one of our sites but I'm having some trouble on the other one. The second site is on a different server and I had to change the SMTP setting in php.ini.

For some reason, when I try the mail() function on a page on that site - No e-mail is sent (I added a conditional - IF (mail($address, $subject, $message)) {print("Success");} - so that I could tell when it sent). Unfortunately I'm not getting errors, so I'm having trouble diagnosing the problem.

"errors_display" is currently set to off - would that be the best place to start?
I'm still new at this, so thank you for your patience.

Toni
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

do a phpinfo and see if imap is installed.

the extensions for email may not be properly installed on your web server, or your email server you are trying to use is not correctly configured on the server or in your script.

had the same problem a few months ago :P
toni
Forum Newbie
Posts: 11
Joined: Fri Jan 09, 2004 8:30 pm

Post by toni »

Thanks, that may be the problem. Do you know where I could find instructions on how to install that module?
User avatar
markl999
DevNet Resident
Posts: 1972
Joined: Thu Oct 16, 2003 5:49 pm
Location: Manchester (UK)

Post by markl999 »

Might be worth first checking the mail log on the server, if it's getting that far it should highlight the problem.
What is this server running btw, *nix, windows etc ? I'm guessing windows as you mention 'SMTP in php.ini' ?
toni
Forum Newbie
Posts: 11
Joined: Fri Jan 09, 2004 8:30 pm

Post by toni »

I did check the mail log and couldn't find any indications that it was even trying to e-mail.

Running on Windows 2000
User avatar
ol4pr0
Forum Regular
Posts: 926
Joined: Thu Jan 08, 2004 11:22 am
Location: ecuador

Post by ol4pr0 »

What do you have in youre SMTP setting?

Dont wanna sound like a wise guy however.. it might have something wrong
toni
Forum Newbie
Posts: 11
Joined: Fri Jan 09, 2004 8:30 pm

Post by toni »

I have an internal IP address in the SMTP setting
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

http://www.php.net/imap is about the best place to start for configuring smtp/imap. not that hard long as you have a mail server.. btw, did you check PHPINFO to see if it was an installed service already??
toni
Forum Newbie
Posts: 11
Joined: Fri Jan 09, 2004 8:30 pm

Post by toni »

Yes, I checked and couldn't find anything regarding IMAP in the PHPINFO.
Thanks for the link.
User avatar
infolock
DevNet Resident
Posts: 1708
Joined: Wed Sep 25, 2002 7:47 pm

Post by infolock »

np, glad to have helped.
Post Reply