Reply
Old 06-03-2004, 11:59 PM PHP Port Problem
Average Talker

Posts: 20
Location: TN
Trades: 0
I thought this would be a good place to get help with this problem I am having. Thanks for looking.

The problem starts:
I wrote some code for a simple feed back form. When the user hits the submit button it redirects them back to the same page with the information submited. Here is the code i wrote to handle it:

<?
#grab the name from the form
$retrieve = $_GET['sender_name'];
#if the form is empty dont do anything
if($retrieve != '')
{
$to = "dyeworks@fastmail.fm";
$subject = "Web Site Feedback";
$mailheaders = "From My Web Site <> \n";
$mailheaders .= "Reply-To:";
$mailheaders .= $_GET['sender_email'];
$mailheaders .="\n\n";
mail($to, $subject, $_GET['sender_message'], $mailheaders);
$msg = "Your E-Mail has been sent<br/>";
}
?>

Unfortunatly, I get an error.
I get this error:

Warning: mail(): Failed to connect to mailserver at "smtp.comcast.net" port 25, verify your "SMTP" and "smtp_port" setting in php.ini or use ini_set() in E:\Program Files\Apache Group\Apache2\htdocs\contactus.php on line 11

I'm hosting my site off my own computer using apache, mysql, and php. I've checked on my mail server setings and I'm pretty sure the problem is linked to Zone Alarm Which I have running as well. I think/know it's blocking the ports I need. The funny thing is I had a simmilar script running before with no problems. Now I'm having problems possibly from an update. If I shut down ZA everything runs fine. I've tried opening up TCP/UDP port ranges, but it doesn't seem to help.

Anyone have any suggestions?? Thanks!
__________________
Still Learning.

James E.

http://www.dyeworks.us
EagleDesigner is offline
Reply With Quote
View Public Profile
 
 
When You Register, These Ads Go Away!
Old 04-25-2008, 12:32 PM Re: PHP Port Problem
Experienced Talker

Posts: 46
Trades: 0
Open port 25 in ZA ?
__________________
Squirrel bombing -> Home of the crasher squirrel
jeff_oneil is offline
Reply With Quote
View Public Profile Visit jeff_oneil's homepage!
 
Old 04-25-2008, 01:42 PM Re: PHP Port Problem
addonchat's Avatar
Super Talker

Posts: 113
Name: Chris Duerr
Trades: 0
Are you planning to run this code on a home PC, or are you just testing?

If you do plan to open up outgoing TCP port 25, I would recommend you restrict it to your app only -- which could be your entire web server.

Does mail() attempt to use sendmail in a Windows environment? Are you using the sendmail app from http://glob.com.au/sendmail/?
__________________
Chris Duerr
AddonChat Java Chat Software
http://www.addonchat.com/ - Affiliate Program
addonchat is offline
Reply With Quote
View Public Profile
 
Old 04-25-2008, 02:56 PM Re: PHP Port Problem
tripy's Avatar
Do not try this at home!

Posts: 3,176
Name: Thierry
Location: I'm the uber Spaminator !
Trades: 0
On windows, you must use a SMTP server top send mail using the mail() command.
This means that the server's PHP.ini must supply the username and password to sent those messages (if a login is required, of course. Not the case everywhere)

Sending the mail is done by "speaking" directly on a TCP session with the server. For this to append, a connection must first be opened to the server.
This is where your problem is, your PHP server cannot talk with a mail server (or the mail server refused to talk with it) an thus, no mail could be sent.
__________________
Only a biker knows why a dog sticks his head out the window.
tripy is online now
Reply With Quote
View Public Profile Visit tripy's homepage!
 
Reply     « Reply to PHP Port Problem
 

Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off





   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 



Page generated in 0.11899 seconds with 13 queries