logo-dw

Go Back   Dreamweaver Club Forums > Hand Coders Forum > PHP
Register FAQ Members List Search Today's Posts Mark Forums Read

Reply
 
Thread Tools Display Modes
Old 08-27-2008, 02:20 PM   #1
slickbet
 
Join Date: Aug 2008
Posts: 6
Question email help

I am new to both DreamWeaver and PHP. I am running a new website on a Windows 2003 server using IIS6. I have PHP version 5 installed and tested using local host successfully. I have created a mail form in DreamWeaver and set it up with the PHP form results found on this site. The form can be filled out by a user, it goes through the script which sends it to the html page that tells the user that the form was sent successfully. All that seems to work well. The problem is the email is never received. I know the email address that the form is set to send to is valid because it's mine. I am not finding any server error messages to give me a clue on what is missing. Your help would be greatly appreciated. Thanks in advance.
slickbet is offline   Reply With Quote
Old 08-27-2008, 02:29 PM   #2
domedia
Administrator
domedia's Avatar
 
Join Date: Dec 2003
Posts: 9,730
Default

You have to give some more information than that.

I'm guessing the error in in your script.. but it's only a guess
domedia is offline   Reply With Quote
Old 08-27-2008, 02:37 PM   #3
slickbet
 
Join Date: Aug 2008
Posts: 6
Default

Here's a copy of my script although I got it from this site and inserted my information in the form fields.
PHP Code:
 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Untitled Document</title>
</head>
<body>
<?php
//--------------------------Set these paramaters--------------------------
// Subject of email sent to you.
$subject 'ContactUs Results'
// Your email address. This is where the form information will be sent. 
$emailadd 'bslechta@srhc.com'
// Where to redirect after form is processed. 
$url 'http://www.srhc.net/contactus/success.html'
// Makes all fields required. If set to '1' no field can not be empty. If set to '0' any or all fields can be empty.
$req '1'
// --------------------------Do not edit below this line--------------------------
$text "Results from form:\n\n"
$space ' ';
$line '
'
;
foreach (
$_POST as $key => $value)
{
if (
$req == '1')
{
if (
$value == '')
{echo 
"$key is empty";die;}
}
$j strlen($key);
if (
$j >= 20)
{echo 
"Name of form element $key cannot be longer than 20 characters";die;}
$j 20 $j;
for (
$i 1$i <= $j$i++)
{
$space .= ' ';}
$value str_replace('\n'"$line"$value);
$conc "{$key}:$space{$value}$line";
$text .= $conc;
$space ' ';
}
mail($emailadd$subject$text'From: '.$emailadd.'');
echo 
'<META HTTP-EQUIV=Refresh CONTENT="0; URL='.$url.'">';
?>
</body>
</html>
Thanks for the quick reply. I appreciate it and hope you can shed some light.
slickbet is offline   Reply With Quote
Old 08-27-2008, 02:52 PM   #4
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

in your php.ini find this line

Code:
SMTP = localhost
smtp_port = 25
make sure its uncommented
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 08-27-2008, 02:57 PM   #5
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

is this on a live machine
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 08-27-2008, 03:39 PM   #6
slickbet
 
Join Date: Aug 2008
Posts: 6
Default email issue

I checked the php.ini. It looks fine. Here's a copy.

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

I'm at a loss. Any ideas on what to look at from here?
slickbet is offline   Reply With Quote
Old 08-27-2008, 04:24 PM   #7
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

is this on a host machine or on your local machine?
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 08-27-2008, 04:31 PM   #8
slickbet
 
Join Date: Aug 2008
Posts: 6
Default email issue

This is on our local server running on our internal network. Once the website is complete the server will be natted out to allow the world to view.
slickbet is offline   Reply With Quote
Old 08-27-2008, 05:25 PM   #9
davidj
davidj's Avatar
 
Join Date: Sep 2005
Location: The Toon (newcastle upon Tyne)
Posts: 8,256
Default

so is there an SMTP server installed

http://www.ilopia.com/Articles/Windo...ailServer.aspx
__________________
Would you like to learn PHP from me? Check out -> www.codezenith.co.uk
davidj is offline   Reply With Quote
Old 08-27-2008, 06:00 PM   #10
slickbet
 
Join Date: Aug 2008
Posts: 6
Default

Yes, the smtp server is installed and the service is running.
slickbet is offline   Reply With Quote
Reply


Thread Tools
Display Modes

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

Forum Jump


All times are GMT. The time now is 10:17 AM.


Powered by vBulletin® Version 3.8.7
Copyright ©2000 - 2018, vBulletin Solutions, Inc.
Copyright 2006 DreamweaverClub.com