Go Back   CodingForums.com > :: Server side development > PHP

Before you post, read our: Rules & Posting Guidelines

Closed Thread
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-26-2002, 05:46 AM   PM User | #1
1234
Banned

 
Join Date: Jul 2002
Posts: 8
Thanks: 0
Thanked 0 Times in 0 Posts
1234 is an unknown quantity at this point
My e-mail system doesn't work help!

help my mail system
hi how are you doing?
I try to run this E-mail system,but it is not working.
my php is 4.2 and My e-mail is STMP so it should be ok
my phpeditor says"Failed to Connect in c:\itohideo\ito2.php on line 29";

One more QUA! Could you tell me when I forget my Pwd, I just send my E-mail. And Pwd goes to my acount.

HOw could you do it. Please send me codes or site which will help me.

E-mail system
save as PK.php
<html>
<body>
<form action="ito2.php" method="post">
<table border="1">
<tbody>
<tr>
<td>Name</td>
<td><input type="text" size="50" maxlength="50" name="yourname">
</td>
</tr>

<tr>
<td>Mailaddress</td>
<td><input type="text" size="50" maxlength="200" name="mailadrs">
</td>
</tr>

<tr>
<td>Mail Title</td>
<td><input type="text" size="50" maxlength="200" name="subject">
</td>
</tr>
<tr>
<td>Comments</td>
<td><textarea ros="10" cols="80" name="msg"></textarea>
</td>
</tr>
</tbody>
</table>
<br>
<input type="submit" name="submit" value="send">
<input type="reset" name="reset" value="reset">
</form>

</body>
</html>

save as ito2.php



<?php
$sendto = "itohideo@domaindlx.com";
$yourname = $_POST['yourname'];
$mailadrs = $_POST['mailadrs'];
$subject = $_POST['subject'];
$msg = $_POST['msg'];
$no = 0;
if ($yourname == "") {
print("Please Enter your Name<br>\n");
$no = 1;
}
if ($mailadrs == "") {
print("Please Enter your mailad<br>\n");
$no = 1;
}
if($subject == "") {
print("Please Enter your title<br>\n");
$no = 1;
}
if ($msg == "") {
print("Please Enter your comments<br>\n");
$no = 1;
}
if ($no != 1) {
$from = "From:" .$yourname. "\n";
mail($sendto, $subject, $msg, $from);
} else {
echo "Mail did not send.";
}
?>


Thank you for helping and time

bye
1234 is offline  
Old 07-26-2002, 10:28 AM   PM User | #2
zoobie
Senior Coder

 
Join Date: Jun 2002
Location: ColoRockyz
Posts: 1,642
Thanks: 1
Thanked 0 Times in 0 Posts
zoobie has a little shameless behaviour in the past
Well, looking at the code really doesn't give us much to go on. SMTP is very tricky. Several things could be wrong...but the most obvious is that you're not connecting. Just because you're sending via SMTP doesn't mean your host has it enabled or that your email host allows for such. Just about every host has their PHP configured differently. Also, I've noticed that the $_Post["yourname"]; seems to need double quotes to pass...believe it or not. Is this Html email? Start with these and ask yourself...do I really need SMTP? Could I get by using the simpler mail() function?Post your errors.
__________________
Zoobie or not Zoobie...That is the problem.
<body onUnload="flush( ! )">
zoobie is offline  
Closed Thread

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

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 +1. The time now is 08:39 AM.


Advertisement
Log in to turn off these ads.