Page 1 of 1

Email form handler

Posted: Sun Aug 03, 2003 9:15 pm
by waboo386
Hey

I'm trying to get a simple email form handler for my site. I tried numerous freeware ones on the net, and much to my dismay, couldn't find one that would send something to my inbox, although they seemed to execute without any syntax error (yes I'm a newby to PHP, but not to programming).

As I couldn't find one that would work, I decided to simplify things, and write an emailing PHP program with ONLY the basics, like so:

Code: Select all

<?
//Declare the variables
ini_set("smtp_port","25");
ini_set("SMTP","localhost");
$recipient = "waboo386@hotmail.com";
$subject = "Testing.. 1 2 3";
$message = "Hi there!";
$from = "some visitor";

//mail() function sends the mail
mail($recipient,$subject,$message,$from);

?>
Notice that I explicitly set the SMTP and the port. For some reason it didn't send at all (it did execute), so I contacted the webmaster of the server, and he said:
Rob,

[root@ps1 root]# telnet localhost 25
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
220 box.prostream.net ESMTP

Works fine here.. May want to check your php code and log files.
Could anybody shed some light here?

Thanks a lot

Rob

Posted: Mon Aug 04, 2003 12:13 am
by waboo386
This is a little desperate here. PLEASE help??