Email form handler

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
waboo386
Forum Newbie
Posts: 6
Joined: Sun Aug 03, 2003 9:15 pm

Email form handler

Post 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
waboo386
Forum Newbie
Posts: 6
Joined: Sun Aug 03, 2003 9:15 pm

Post by waboo386 »

This is a little desperate here. PLEASE help??
Post Reply