Page 1 of 1
Formsend Function
Posted: Sun Mar 27, 2005 1:57 pm
by Tim1681
Hey guys, got a question. On my site i want to put some Forms. I have the code installed and when I test it out, everything works dandy on the client side. But on the server side it does not send the form as an email. I've opened port 25 for the server but still nada

. Is there a certain Module i need to install or something i need to change in my php.INI?
Posted: Sun Mar 27, 2005 2:06 pm
by Ambush Commander
If this is your own server, that is, you've installed PHP on your own computer, you may have fallen victim to a blocked SMTP port by your ISP. I know optonline does that, so you have to configure PHP to use their SMTP server to send outbound emails. What's your ISP?
Posted: Sun Mar 27, 2005 2:07 pm
by feyd
post. your. code.
Posted: Sun Mar 27, 2005 2:12 pm
by Tim1681
My ISP Is comcast, so it wouldnt surprise me if they did block the SMTP Port.
Code: Select all
<?
$name = $_POST["name"];
$address = $_POST["address"];
$city = $_POST["city"];
$state = $_POST["state"];
$zip = $_POST["zip"];
$phone = $_POST["phone"];
$email = $_POST["email"];
$comments = $_POST["comments"];
$today = date("M d, Y");
$recipient = "zerogroundz@gmail.com";
$subject = "Web Form Results";
$forminfo =
"Name: $name\n
Address: $address\n
City: $city\n
State: $state\n
Zip: $zip\n
Phone: $phone\n
Email: $email\n
Comments: $comments\n
Form Submitted: $today\n\n";
$formsend = mail("$recipient", "$subject", "$forminfo", "From: $email\r\nReply-to:$email");
?>
There's an HTML page that sends the Info to this page. If you want me to post that code, I will.
feyd | Please review how to post code using Code: Select all
tags. Read: [url=http://forums.devnetwork.net/viewtopic.php?t=21171]Posting Code in the Forums[/url][/color]
Posted: Sun Mar 27, 2005 2:19 pm
by feyd
..and your server is your local machine? If so, Comcast is blocking most users access to SMTP relay. In this case, you need to use an SMTP mailer script, like phpmailer. If I recall correctly, it allows you to log into your real smtp server, and thus email like "normal."
Posted: Sun Mar 27, 2005 2:20 pm
by Ambush Commander
Hmm... it doesn't look like anything is wrong. Comcast's blocking is pretty spotty:
http://www.unspam.com/fight_spam/articles/1394.html
Try rerouting your smtp connection via these INI changes:
Code: Select all
їmail function]
; For Win32 only.
SMTP = smtp.comcast.net ; for Win32 only
smtp_port = 25
sendmail_from= someemailaddress@exampledomain.com; for Win32 only
Posted: Sun Mar 27, 2005 2:25 pm
by Tim1681
TY Very Much Ambush!

Works like a charm

You should get a raise
Posted: Sun Mar 27, 2005 3:11 pm
by Tim1681
In my code i have the line:
Code: Select all
$recipient = "zerogroundz@gmail.com";
Is there anyway to have a CC made and sent to another Email Address?
Thnx in advance!

Posted: Sun Mar 27, 2005 3:14 pm
by Ambush Commander
Check out the PHP documentation for mail() :
http://us4.php.net/manual/en/function.mail.php and also do some research on email headers.
Posted: Sun Mar 27, 2005 3:24 pm
by Tim1681
Thnx Again. lol
