|
Posted by cover on 01/24/06 06:54
I have a form that writes to an MySQL database just fine but would
like to email people to give them a heads up that an entry was made
under their name (1 of 6 names on writing to the database). This
server exists on an intranet and would have no 'web' function other
than using possibly the existing email server.
Is all that I need to do to make this happen, to change php.ini as
follows:
[mail function]
; For Win32 only.
SMTP = mail.servername.com
smtp_port = 25
; For Win32 only.
;sendmail_from = whoever@servername.com
My input form is as follows:
<form action="process2.php" method="post">
From: <input type="text" name="from" size="20" maxlength="20" /><br />
To: <input type="text" name="to" size="30" maxlength="30" /><br />
Subject: <input type="text" name="subject" size="30" maxlength="30"
/><br />
Message:<textarea name="text" name="message" cols="50"
rows="10"></textarea><br />
<input type="submit" name="submit" value="Send" />
</form>
and passes data to process2.php as shown in form 1:
<?php
@extract($_POST);
$from = stripslashes($from);
$to = stripslashes($to);
$subject = stripslashes($subject);
$message = stripslashes($message);
mail('$to',$from,$subject,$message);
header("location:process.php");
?>
This worked through my testbed on my SMTP 'once' and only sort of,
once so I might be missing something. :-) TIA for any help.
Navigation:
[Reply to this message]
|