PHP E-Mail Problems

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
ut1205
Forum Commoner
Posts: 32
Joined: Thu Jan 29, 2004 5:12 pm

PHP E-Mail Problems

Post by ut1205 »

I've just tried a couple of Free E-Mail scripts and get error messages when I try to send them. I figuered my Cable ISP was blocking my E-Mail Ports but a scan of my ports showed Port 25 and Port 110 "Closed but Not Blocked - No Program Using Them".

Second Question: Where is php.ini. I can't find it even with a search of my drives.

Below is the script I tried and at the bottom the error message I recieved.
Am I doing something wrong?

<HTML>

<HEAD>
</HEAD>

<BODY>

Code: Select all

<?php
@extract($_POST);
$name = stripslashes($name);
$email = stripslashes($email);
$subject = stripslashes($subject);
$text = stripslashes($text);
mail('test@test.com',$subject,$text,"From: $name <$email>");
header("location:form.php");
?>
</BODY>
</HTML>

Error Message Received:

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:\Phperl2.3\Websites\Site1\www\process.php

Thanks

Jim
Straterra
Forum Regular
Posts: 527
Joined: Mon Nov 24, 2003 8:46 am
Location: Indianapolis, Indiana
Contact:

Post by Straterra »

Mine is in my Windows directory..I assume you host your own site?
ut1205
Forum Commoner
Posts: 32
Joined: Thu Jan 29, 2004 5:12 pm

Found It

Post by ut1205 »

Found it in Windows. It id's as a "config" file not an .ini. The only mail setting I could find are:

[mail function]
; For Win32 only.
SMTP = localhost

; For Win32 only.
sendmail_from = admin@localhost.com

I don't know if these are right or not.
Yes I do have a server and host my own site.

Thanks for the reply.

Jim
Post Reply