Page 1 of 1

How to test sendmail on local machine?

Posted: Mon Mar 01, 2004 2:40 am
by sabas
<HTML>
<HEAD><TITLE>E-mail</TITLE>

<FORM METHOD=POST ACTION="sendmail.php">

<TABLE>
<TR>
<TD>E-mail:</TD>
<TD> <INPUT TYPE="text" NAME="email" size="25" /></TD>
</TR>
<TR>
<TD valign=top>Message:</TD>
<TD> <TEXTAREA NAME="message" ROWS="15" COLS="40"></TEXTAREA> <p></TD>
</TR>
<TR>
<TD colspan="2" align=center><INPUT name="submit" TYPE="submit" value="Submit"></TD>
</TR>
</TABLE>

</FORM>

</HEAD>
</HTML>

----------------

sendmail.php:

<?php
$email = $_REQUEST['email'];
$message = $_REQUEST['message'];

mail("myemail@yahoo.com","FeedBackt", $message, "From: $email");
header("Location: thankyou.html");
?>


I got a "Save As" dialog when I hit the button Submit. That's weird! could anybody tell me why thankyou.html has not come up?

(I put both of them in the folder C:\AppSer\apache\htdocs)

Posted: Mon Mar 01, 2004 11:53 am
by ol4pr0
Do you have php installed ?

make a page with this code .

Code: Select all

<?
phpinfo();
?>
save it as test.php and run it..

http://localhost/test.php

Posted: Mon Mar 01, 2004 10:05 pm
by sabas
I already installed php and I also got phpinfo.php (or test.php as you called) that works fine. So ?

Posted: Mon Mar 01, 2004 10:47 pm
by maldar
You can not test sendmail functionality on localhost and you need a real host .
but if you want send mail from localhost , it is possible.
for more info take a look at this :
viewtopic.php?t=12462&highlight=

Posted: Mon Mar 01, 2004 11:40 pm
by Steveo31

How to test sendmail on local machine?

Posted: Wed Mar 03, 2004 9:08 pm
by sabas
Thanks very much,