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@servern ame.com
My input form is as follows:
<form action="process 2.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:<textar ea 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($f rom);
$to = stripslashes($t o);
$subject = stripslashes($s ubject);
$message = stripslashes($m essage);
mail('$to',$fro m,$subject,$mes sage);
header("locatio n: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.
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@servern ame.com
My input form is as follows:
<form action="process 2.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:<textar ea 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($f rom);
$to = stripslashes($t o);
$subject = stripslashes($s ubject);
$message = stripslashes($m essage);
mail('$to',$fro m,$subject,$mes sage);
header("locatio n: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.
Comment